Runtime call graph + dynamic data-flow tracer with backward slicing. 更多...
#include <CallGraph.hpp>
类 | |
| class | EventsView |
| Chronological view over the live ring window (oldest → newest). 更多... | |
Public 成员函数 | |
| CallGraph () | |
| ~CallGraph () | |
| CallGraph (const CallGraph &)=delete | |
| CallGraph & | operator= (const CallGraph &)=delete |
| void | clear () |
| void | setMaxEvents (size_t n) |
| size_t | maxEvents () const |
| size_t | eventCount () const |
| uint32_t | onCall (const SourceLoc &loc, const std::string &funcName={}) |
| uint32_t | onReturn (const SourceLoc &loc, const std::string &funcName={}) |
| uint32_t | onLine (const SourceLoc &loc) |
| uint32_t | onDef (const SourceLoc &loc, const std::string &var) |
| uint32_t | onUse (const SourceLoc &loc, const std::string &var) |
| uint32_t | enter (const SourceLoc &loc, const std::string &funcName) |
| Convenience: Call then Line at the same site. | |
| EventsView | events () const |
| const TraceEvent * | event (uint32_t id) const |
| std::vector< CallFrame > | currentStack () const |
| std::vector< CallFrame > | stackAt (uint32_t eventId) const |
| Stack reconstructed at (or just before) a given event. | |
| std::vector< std::pair< SourceLoc, SourceLoc > > | callEdges () const |
| SliceResult | sliceBackward (const SliceCriterion &criterion) const |
| Dynamic backward slice from an error criterion. Follows data dependencies (Use←Def) and control predecessors (line order + call/return nesting) until a fixed point. | |
| std::string | formatErrorReport (const std::string &errorMessage, const SliceCriterion &criterion) const |
| Human-readable report: message + call stack + data-flow + slice locs. | |
友元 | |
| class | EventsView |
| class | EventsView::const_iterator |
详细描述
Runtime call graph + dynamic data-flow tracer with backward slicing.
Feed events from a Squirrel debug hook (see DevTool) or manually in tests. On script failure, use sliceBackward() to recover the statements and definitions that influenced the error site — analogous to a dynamic slicer.
Event storage is a fixed ring buffer: when full, the write cursor advances and overwrites the oldest slot in place (O(1); monotonic ids).
在文件 CallGraph.hpp 第 81 行定义.
构造及析构函数说明
◆ CallGraph() [1/2]
|
default |
◆ ~CallGraph()
|
default |
◆ CallGraph() [2/2]
|
delete |
成员函数说明
◆ callEdges()
在文件 CallGraph.cpp 第 246 行定义.
引用了 eve::dev::Call, eve::dev::TraceEvent::kind, eve::dev::TraceEvent::loc , 以及 eve::dev::Return.
◆ clear()
| void eve::dev::CallGraph::clear | ( | ) |
在文件 CallGraph.cpp 第 31 行定义.
被这些函数引用 eve::dev::DevTool::attach().
◆ currentStack()
| std::vector< CallFrame > eve::dev::CallGraph::currentStack | ( | ) | const |
在文件 CallGraph.cpp 第 211 行定义.
引用了 event(), f , 以及 eve::dev::CallFrame::frameId.
被这些函数引用 eve::dev::DevTool::handleDebugEvent() , 以及 eve::dev::mcpCallgraphStackDepth().
◆ enter()
| uint32_t eve::dev::CallGraph::enter | ( | const SourceLoc & | loc, |
| const std::string & | funcName | ||
| ) |
Convenience: Call then Line at the same site.
在文件 CallGraph.cpp 第 198 行定义.
◆ event()
| const TraceEvent * eve::dev::CallGraph::event | ( | uint32_t | id | ) | const |
在文件 CallGraph.cpp 第 203 行定义.
被这些函数引用 currentStack(), formatErrorReport(), sliceBackward() , 以及 stackAt().
◆ eventCount()
|
inline |
在文件 CallGraph.hpp 第 92 行定义.
◆ events()
|
inline |
◆ formatErrorReport()
| std::string eve::dev::CallGraph::formatErrorReport | ( | const std::string & | errorMessage, |
| const SliceCriterion & | criterion | ||
| ) | const |
Human-readable report: message + call stack + data-flow + slice locs.
在文件 CallGraph.cpp 第 396 行定义.
引用了 a, b, eve::dev::SliceResult::callStack, eve::dev::SliceResult::dataFlow, eve::dev::SourceLoc::empty(), event(), f, line, eve::dev::TraceEvent::loc, eve::dev::SliceCriterion::loc, eve::dev::SliceResult::locations, os, s, sliceBackward(), eve::dev::SliceResult::summary, eve::dev::SourceLoc::toString() , 以及 eve::dev::SliceCriterion::variables.
被这些函数引用 eve::dev::DevTool::formatError().
◆ maxEvents()
|
inline |
在文件 CallGraph.hpp 第 91 行定义.
◆ onCall()
| uint32_t eve::dev::CallGraph::onCall | ( | const SourceLoc & | loc, |
| const std::string & | funcName = {} |
||
| ) |
在文件 CallGraph.cpp 第 115 行定义.
引用了 eve::dev::Call, fn, eve::dev::TraceEvent::frameId, eve::dev::SourceLoc::function , 以及 id.
被这些函数引用 enter() , 以及 eve::dev::DevTool::handleDebugEvent().
◆ onDef()
| uint32_t eve::dev::CallGraph::onDef | ( | const SourceLoc & | loc, |
| const std::string & | var | ||
| ) |
在文件 CallGraph.cpp 第 139 行定义.
引用了 eve::dev::Def, eve::dev::TraceEvent::frameId , 以及 id.
◆ onLine()
| uint32_t eve::dev::CallGraph::onLine | ( | const SourceLoc & | loc | ) |
在文件 CallGraph.cpp 第 135 行定义.
引用了 eve::dev::Line.
被这些函数引用 enter() , 以及 eve::dev::DevTool::handleDebugEvent().
◆ onReturn()
| uint32_t eve::dev::CallGraph::onReturn | ( | const SourceLoc & | loc, |
| const std::string & | funcName = {} |
||
| ) |
在文件 CallGraph.cpp 第 125 行定义.
引用了 fn, eve::dev::TraceEvent::frameId, eve::dev::SourceLoc::function, id , 以及 eve::dev::Return.
◆ onUse()
| uint32_t eve::dev::CallGraph::onUse | ( | const SourceLoc & | loc, |
| const std::string & | var | ||
| ) |
在文件 CallGraph.cpp 第 154 行定义.
引用了 id , 以及 eve::dev::Use.
◆ operator=()
◆ setMaxEvents()
| void eve::dev::CallGraph::setMaxEvents | ( | size_t | n | ) |
在文件 CallGraph.cpp 第 47 行定义.
引用了 n.
◆ sliceBackward()
| SliceResult eve::dev::CallGraph::sliceBackward | ( | const SliceCriterion & | criterion | ) | const |
Dynamic backward slice from an error criterion. Follows data dependencies (Use←Def) and control predecessors (line order + call/return nesting) until a fixed point.
在文件 CallGraph.cpp 第 315 行定义.
引用了 eve::dev::Call, eve::dev::SliceResult::callStack, eve::dev::SliceResult::dataFlow, eve::dev::SourceLoc::empty(), event(), eve::dev::SliceResult::eventIds, eve::dev::TraceEvent::frameId, eve::dev::DataFlowEdge::fromEventId, eve::dev::TraceEvent::id, id, eve::dev::TraceEvent::kind, eve::dev::TraceEvent::loc, eve::dev::SliceResult::locations, eve::dev::TraceEvent::name, os, eve::dev::TraceEvent::parentEventId, eve::dev::Return, s, stackAt(), eve::dev::SliceResult::summary, eve::dev::DataFlowEdge::toEventId, eve::dev::SourceLoc::toString() , 以及 eve::dev::DataFlowEdge::var.
被这些函数引用 eve::dev::DevTool::analyzeError() , 以及 formatErrorReport().
◆ stackAt()
| std::vector< CallFrame > eve::dev::CallGraph::stackAt | ( | uint32_t | eventId | ) | const |
Stack reconstructed at (or just before) a given event.
在文件 CallGraph.cpp 第 227 行定义.
引用了 eve::dev::Call, event(), f, eve::dev::TraceEvent::frameId, eve::dev::CallFrame::frameId, eve::dev::TraceEvent::id, eve::dev::TraceEvent::kind, eve::dev::TraceEvent::loc , 以及 eve::dev::Return.
被这些函数引用 sliceBackward().
友元及相关函数文档
◆ EventsView
|
friend |
在文件 CallGraph.hpp 第 175 行定义.
◆ EventsView::const_iterator
|
friend |
在文件 CallGraph.hpp 第 176 行定义.
该类的文档由以下文件生成:
- src/engine/devtools/CallGraph.hpp
- src/engine/devtools/CallGraph.cpp