OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ | 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ |
6 #define V8_DEBUG_DEBUG_INTERFACE_H_ | 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "include/v8-debug.h" | 10 #include "include/v8-debug.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state); | 84 void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state); |
85 | 85 |
86 enum StepAction { | 86 enum StepAction { |
87 StepOut = 0, // Step out of the current function. | 87 StepOut = 0, // Step out of the current function. |
88 StepNext = 1, // Step to the next statement in the current function. | 88 StepNext = 1, // Step to the next statement in the current function. |
89 StepIn = 2 // Step into new functions invoked or the next statement | 89 StepIn = 2 // Step into new functions invoked or the next statement |
90 // in the current function. | 90 // in the current function. |
91 }; | 91 }; |
92 | 92 |
93 void PrepareStep(Isolate* isolate, StepAction action); | 93 void PrepareStep(Isolate* isolate, StepAction action); |
| 94 void ClearStepping(Isolate* isolate); |
94 | 95 |
95 bool HasNonBlackboxedFrameOnStack(Isolate* isolate); | 96 bool HasNonBlackboxedFrameOnStack(Isolate* isolate); |
96 | 97 |
97 /** | 98 /** |
98 * Out-of-memory callback function. | 99 * Out-of-memory callback function. |
99 * The function is invoked when the heap size is close to the hard limit. | 100 * The function is invoked when the heap size is close to the hard limit. |
100 * | 101 * |
101 * \param data the parameter provided during callback installation. | 102 * \param data the parameter provided during callback installation. |
102 */ | 103 */ |
103 typedef void (*OutOfMemoryCallback)(void* data); | 104 typedef void (*OutOfMemoryCallback)(void* data); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 }; | 146 }; |
146 | 147 |
147 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); | 148 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); |
148 | 149 |
149 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, | 150 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, |
150 Local<String> source); | 151 Local<String> source); |
151 | 152 |
152 class DebugDelegate { | 153 class DebugDelegate { |
153 public: | 154 public: |
154 virtual ~DebugDelegate() {} | 155 virtual ~DebugDelegate() {} |
155 virtual void PromiseEventOccurred(debug::PromiseDebugActionType type, int id, | 156 virtual void PromiseEventOccurred(debug::PromiseDebugActionType type, |
156 int parent_id) {} | 157 int id) {} |
| 158 virtual void PromiseCreatedEvent(int id, int parent_id, bool is_breakable) {} |
157 virtual void ScriptCompiled(v8::Local<Script> script, | 159 virtual void ScriptCompiled(v8::Local<Script> script, |
158 bool has_compile_error) {} | 160 bool has_compile_error) {} |
159 virtual void BreakProgramRequested(v8::Local<v8::Context> paused_context, | 161 virtual void BreakProgramRequested(v8::Local<v8::Context> paused_context, |
160 v8::Local<v8::Object> exec_state, | 162 v8::Local<v8::Object> exec_state, |
161 v8::Local<v8::Value> break_points_hit) {} | 163 v8::Local<v8::Value> break_points_hit) {} |
162 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, | 164 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, |
163 v8::Local<v8::Object> exec_state, | 165 v8::Local<v8::Object> exec_state, |
164 v8::Local<v8::Value> exception, | 166 v8::Local<v8::Value> exception, |
165 bool is_promise_rejection, bool is_uncaught) {} | 167 bool is_promise_rejection, bool is_uncaught) {} |
166 virtual bool IsFunctionBlackboxed(v8::Local<debug::Script> script, | 168 virtual bool IsFunctionBlackboxed(v8::Local<debug::Script> script, |
167 const debug::Location& start, | 169 const debug::Location& start, |
168 const debug::Location& end) { | 170 const debug::Location& end) { |
169 return false; | 171 return false; |
170 } | 172 } |
171 }; | 173 }; |
172 | 174 |
173 void SetDebugDelegate(Isolate* isolate, DebugDelegate* listener); | 175 void SetDebugDelegate(Isolate* isolate, DebugDelegate* listener); |
174 | 176 |
175 void ResetBlackboxedStateCache(Isolate* isolate, | 177 void ResetBlackboxedStateCache(Isolate* isolate, |
176 v8::Local<debug::Script> script); | 178 v8::Local<debug::Script> script); |
177 | 179 |
178 } // namespace debug | 180 } // namespace debug |
179 } // namespace v8 | 181 } // namespace v8 |
180 | 182 |
181 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 183 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
OLD | NEW |