v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
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:
26 Location GetLocation() const;
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
63 Local<String> GetScriptName() const;
64
71 Local<String> GetScriptNameOrSourceURL() const;
72
76 Local<String> GetScriptSource() const;
77
82 Local<String> GetScriptSourceMappingURL() const;
83
87 Local<String> GetFunctionName() const;
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
161 static Local<StackTrace> CurrentStackTrace(
162 Isolate* isolate, int frame_limit, StackTraceOptions options = kDetailed);
163
174 static Local<String> CurrentScriptNameOrSourceURL(Isolate* isolate);
175};
176
177} // namespace v8
178
179#endif // INCLUDE_V8_DEBUG_H_
int GetLineNumber()
Definition v8-script.h:114
int GetColumnNumber()
Definition v8-script.h:115
int GetLineNumber() const
Definition v8-debug.h:34
int GetColumn() const
Definition v8-debug.h:43
v8_inspector::String16 String
Definition string-util.h:26
#define V8_EXPORT
Definition v8config.h:800