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_
Definition: v8-isolate.h:210
Definition: v8-local-handle.h:258
Definition: v8-script.h:112
Definition: v8-debug.h:21
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:111
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:119
int GetFrameCount() const
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:762