Loading...
Searching...
No Matches
v8-debug.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_DEBUG_H_
6#define INCLUDE_V8_DEBUG_H_
7
8#include <stdint.h>
9
10#include "v8-script.h" // NOLINT(build/include_directory)
11#include "v8config.h" // NOLINT(build/include_directory)
12
13namespace v8 {
14
15class Isolate;
16class String;
17
22 public:
27
34 int GetLineNumber() const { return GetLocation().GetLineNumber() + 1; }
35
43 int GetColumn() const { return GetLocation().GetColumnNumber() + 1; }
44
49 int GetSourcePosition() const;
50
57 int GetScriptId() const;
58
64
72
77
83
88
93 bool IsEval() const;
94
99 bool IsConstructor() const;
100
104 bool IsWasm() const;
105
109 bool IsUserJavaScript() const;
110};
111
118 public:
126 kLineNumber = 1,
127 kColumnOffset = 1 << 1 | kLineNumber,
128 kScriptName = 1 << 2,
129 kFunctionName = 1 << 3,
130 kIsEval = 1 << 4,
131 kIsConstructor = 1 << 5,
132 kScriptNameOrSourceURL = 1 << 6,
133 kScriptId = 1 << 7,
134 kExposeFramesAcrossSecurityOrigins = 1 << 8,
135 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
136 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
137 };
138
142 int GetID() const;
143
147 Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
148
152 int GetFrameCount() const;
153
162 Isolate* isolate, int frame_limit, StackTraceOptions options = kDetailed);
163
175};
176
177} // namespace v8
178
179#endif // INCLUDE_V8_DEBUG_H_
Definition: v8-isolate.h:261
Definition: v8-local-handle.h:266
Definition: v8-script.h:112
Definition: v8-debug.h:21
int GetSourcePosition() const
int GetLineNumber() const
Definition: v8-debug.h:34
int GetColumn() const
Definition: v8-debug.h:43
bool IsUserJavaScript() const
Local< String > GetScriptName() const
Local< String > GetScriptNameOrSourceURL() const
Location GetLocation() const
Local< String > GetScriptSourceMappingURL() const
bool IsConstructor() const
bool IsEval() const
Local< String > GetFunctionName() const
int GetScriptId() const
Local< String > GetScriptSource() const
bool IsWasm() const
Definition: v8-debug.h:117
Local< StackFrame > GetFrame(Isolate *isolate, uint32_t index) const
static Local< StackTrace > CurrentStackTrace(Isolate *isolate, int frame_limit, StackTraceOptions options=kDetailed)
static Local< String > CurrentScriptNameOrSourceURL(Isolate *isolate)
StackTraceOptions
Definition: v8-debug.h:125
int GetFrameCount() const
int GetID() const
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:793