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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 int NumFunctions() const; | 140 int NumFunctions() const; |
141 int NumImportedFunctions() const; | 141 int NumImportedFunctions() const; |
142 | 142 |
143 std::pair<int, int> GetFunctionRange(int function_index) const; | 143 std::pair<int, int> GetFunctionRange(int function_index) const; |
144 | 144 |
145 debug::WasmDisassembly DisassembleFunction(int function_index) const; | 145 debug::WasmDisassembly DisassembleFunction(int function_index) const; |
146 }; | 146 }; |
147 | 147 |
148 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); | 148 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); |
149 | 149 |
| 150 // Calls DebugDelegate::ModuleRequested for any modules that were requested |
| 151 // during other module evaluation. |
| 152 void ReportRequestedModules(Isolate* isolate); |
| 153 |
150 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, | 154 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, |
151 Local<String> source); | 155 Local<String> source); |
152 | 156 |
153 class DebugDelegate { | 157 class DebugDelegate { |
154 public: | 158 public: |
155 virtual ~DebugDelegate() {} | 159 virtual ~DebugDelegate() {} |
156 virtual void PromiseEventOccurred(debug::PromiseDebugActionType type, int id, | 160 virtual void PromiseEventOccurred(debug::PromiseDebugActionType type, int id, |
157 int parent_id) {} | 161 int parent_id) {} |
158 virtual void ScriptCompiled(v8::Local<Script> script, | 162 virtual void ScriptCompiled(v8::Local<Script> script, |
159 bool has_compile_error) {} | 163 bool has_compile_error) {} |
160 virtual void BreakProgramRequested(v8::Local<v8::Context> paused_context, | 164 virtual void BreakProgramRequested(v8::Local<v8::Context> paused_context, |
161 v8::Local<v8::Object> exec_state, | 165 v8::Local<v8::Object> exec_state, |
162 v8::Local<v8::Value> break_points_hit) {} | 166 v8::Local<v8::Value> break_points_hit) {} |
163 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, | 167 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, |
164 v8::Local<v8::Object> exec_state, | 168 v8::Local<v8::Object> exec_state, |
165 v8::Local<v8::Value> exception, | 169 v8::Local<v8::Value> exception, |
166 bool is_promise_rejection, bool is_uncaught) {} | 170 bool is_promise_rejection, bool is_uncaught) {} |
167 virtual bool IsFunctionBlackboxed(v8::Local<debug::Script> script, | 171 virtual bool IsFunctionBlackboxed(v8::Local<debug::Script> script, |
168 const debug::Location& start, | 172 const debug::Location& start, |
169 const debug::Location& end) { | 173 const debug::Location& end) { |
170 return false; | 174 return false; |
171 } | 175 } |
| 176 virtual void ModuleRequested(v8::Local<debug::Script> referer, |
| 177 v8::Local<debug::Script> requested, |
| 178 v8::Local<v8::String> specifier) {} |
172 }; | 179 }; |
173 | 180 |
174 void SetDebugDelegate(Isolate* isolate, DebugDelegate* listener); | 181 void SetDebugDelegate(Isolate* isolate, DebugDelegate* listener); |
175 | 182 |
176 void ResetBlackboxedStateCache(Isolate* isolate, | 183 void ResetBlackboxedStateCache(Isolate* isolate, |
177 v8::Local<debug::Script> script); | 184 v8::Local<debug::Script> script); |
178 | 185 |
179 int EstimatedValueSize(Isolate* isolate, v8::Local<v8::Value> value); | 186 int EstimatedValueSize(Isolate* isolate, v8::Local<v8::Value> value); |
180 | 187 |
181 } // namespace debug | 188 } // namespace debug |
182 } // namespace v8 | 189 } // namespace v8 |
183 | 190 |
184 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 191 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
OLD | NEW |