#include <v8-debug.h>
Classes | |
| struct | ScriptIdAndContext |
Public Types | |
| enum | StackTraceOptions { kLineNumber = 1 , kColumnOffset = 1 << 1 | kLineNumber , kScriptName = 1 << 2 , kFunctionName = 1 << 3 , kIsEval = 1 << 4 , kIsConstructor = 1 << 5 , kScriptNameOrSourceURL = 1 << 6 , kScriptId = 1 << 7 , kExposeFramesAcrossSecurityOrigins = 1 << 8 , kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName , kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL } |
Public Member Functions | |
| int | GetID () const |
| Local< StackFrame > | GetFrame (Isolate *isolate, uint32_t index) const |
| int | GetFrameCount () const |
Static Public Member Functions | |
| static Local< StackTrace > | CurrentStackTrace (Isolate *isolate, int frame_limit, StackTraceOptions options=kDetailed) |
| static Local< String > | CurrentScriptNameOrSourceURL (Isolate *isolate) |
| static int | CurrentScriptId (Isolate *isolate) |
| static v8::MemorySpan< v8::StackTrace::ScriptIdAndContext > | CurrentScriptIdsAndContexts (Isolate *isolate, v8::MemorySpan< ScriptIdAndContext > frame_data) |
Representation of a JavaScript stack trace. The information collected is a snapshot of the execution stack and the information remains valid after execution continues.
Flags that determine what information is placed captured for each StackFrame when grabbing the current stack trace. Note: these options are deprecated and we always collect all available information (kDetailed).
| Enumerator | |
|---|---|
| kLineNumber | |
| kColumnOffset | |
| kScriptName | |
| kFunctionName | |
| kIsEval | |
| kIsConstructor | |
| kScriptNameOrSourceURL | |
| kScriptId | |
| kExposeFramesAcrossSecurityOrigins | |
| kOverview | |
| kDetailed | |
|
static |
Returns the first valid script id at the top of the JS stack. The returned value is Message::kNoScriptIdInfo if no id was found.
This method is equivalent to calling StackTrace::CurrentStackTrace and walking the resulting frames from the beginning until a non-empty id is found. The difference is that this method won't allocate a stack trace.
|
static |
Writes up to the first frame_data.size() valid script ids and function contexts at the top of the JS stack into the given span. Returns a span sized to the number of frames worth of data written. It's similar to the CurrentStackTrace method but doesn't allocate a stack trace. Further, it skips frames that don't have valid script ids or function contexts. The final difference is that the script id written for evals or regexp is that of the script that ran eval() or regexp, not the current context.
WARNING: This is an unfinished experimental feature. Semantics and implementation may change frequently.
Returns the first valid script name or source URL starting at the top of the JS stack. The returned string is either an empty handle if no script name/url was found or a non-zero-length string.
This method is equivalent to calling StackTrace::CurrentStackTrace and walking the resulting frames from the beginning until a non-empty script name/url is found. The difference is that this method won't allocate a stack trace.
|
static |
Grab a snapshot of the current JavaScript execution stack.
| frame_limit | The maximum number of stack frames we want to capture. |
| options | Enumerates the set of things we will capture for each StackFrame. |
| Local< StackFrame > v8::StackTrace::GetFrame | ( | Isolate * | isolate, |
| uint32_t | index | ||
| ) | const |
Returns a StackFrame at a particular index.
| int v8::StackTrace::GetFrameCount | ( | ) | const |
Returns the number of StackFrames.
| int v8::StackTrace::GetID | ( | ) | const |
Returns the (unique) ID of this stack trace.