v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
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
51 int GetScriptId() const;
52
58
66
71
77
82
87 bool IsEval() const;
88
93 bool IsConstructor() const;
94
98 bool IsWasm() const;
99
103 bool IsUserJavaScript() const;
104};
105
112 public:
120 kLineNumber = 1,
121 kColumnOffset = 1 << 1 | kLineNumber,
122 kScriptName = 1 << 2,
123 kFunctionName = 1 << 3,
124 kIsEval = 1 << 4,
125 kIsConstructor = 1 << 5,
126 kScriptNameOrSourceURL = 1 << 6,
127 kScriptId = 1 << 7,
128 kExposeFramesAcrossSecurityOrigins = 1 << 8,
129 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
130 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
131 };
132
136 Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
137
141 int GetFrameCount() const;
142
151 Isolate* isolate, int frame_limit, StackTraceOptions options = kDetailed);
152
164};
165
166} // namespace v8
167
168#endif // INCLUDE_V8_DEBUG_H_
Location GetLocation() const
bool IsWasm() const
Local< String > GetFunctionName() const
int GetColumn() const
Definition v8-debug.h:43
bool IsUserJavaScript() const
Local< String > GetScriptName() const
int GetLineNumber() const
Definition v8-debug.h:34
bool IsConstructor() const
Local< String > GetScriptSource() const
int GetScriptId() const
bool IsEval() const
Local< String > GetScriptNameOrSourceURL() const
Local< String > GetScriptSourceMappingURL() const
static Local< String > CurrentScriptNameOrSourceURL(Isolate *isolate)
int GetFrameCount() const
static Local< StackTrace > CurrentStackTrace(Isolate *isolate, int frame_limit, StackTraceOptions options=kDetailed)
Local< StackFrame > GetFrame(Isolate *isolate, uint32_t index) const
#define V8_EXPORT
Definition v8config.h:578