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_INSPECTOR_V8DEBUGGER_H_ | 5 #ifndef V8_INSPECTOR_V8DEBUGGER_H_ |
6 #define V8_INSPECTOR_V8DEBUGGER_H_ | 6 #define V8_INSPECTOR_V8DEBUGGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void setBreakpointsActivated(bool); | 39 void setBreakpointsActivated(bool); |
40 bool breakpointsActivated() const { return m_breakpointsActivated; } | 40 bool breakpointsActivated() const { return m_breakpointsActivated; } |
41 | 41 |
42 v8::debug::ExceptionBreakState getPauseOnExceptionsState(); | 42 v8::debug::ExceptionBreakState getPauseOnExceptionsState(); |
43 void setPauseOnExceptionsState(v8::debug::ExceptionBreakState); | 43 void setPauseOnExceptionsState(v8::debug::ExceptionBreakState); |
44 void setPauseOnNextStatement(bool); | 44 void setPauseOnNextStatement(bool); |
45 bool canBreakProgram(); | 45 bool canBreakProgram(); |
46 void breakProgram(); | 46 void breakProgram(); |
47 void continueProgram(); | 47 void continueProgram(); |
48 void stepIntoStatement(); | 48 void stepIntoStatement(); |
| 49 Response stepIntoAsync(); |
49 void stepOverStatement(); | 50 void stepOverStatement(); |
50 void stepOutOfFunction(); | 51 void stepOutOfFunction(); |
51 | 52 |
52 Response setScriptSource( | 53 Response setScriptSource( |
53 const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun, | 54 const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun, |
54 protocol::Maybe<protocol::Runtime::ExceptionDetails>*, | 55 protocol::Maybe<protocol::Runtime::ExceptionDetails>*, |
55 JavaScriptCallFrames* newCallFrames, protocol::Maybe<bool>* stackChanged, | 56 JavaScriptCallFrames* newCallFrames, protocol::Maybe<bool>* stackChanged, |
56 bool* compileError); | 57 bool* compileError); |
57 JavaScriptCallFrames currentCallFrames(int limit = 0); | 58 JavaScriptCallFrames currentCallFrames(int limit = 0); |
58 | 59 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 }; | 127 }; |
127 v8::MaybeLocal<v8::Value> getTargetScopes(v8::Local<v8::Context>, | 128 v8::MaybeLocal<v8::Value> getTargetScopes(v8::Local<v8::Context>, |
128 v8::Local<v8::Value>, | 129 v8::Local<v8::Value>, |
129 ScopeTargetKind); | 130 ScopeTargetKind); |
130 | 131 |
131 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, | 132 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, |
132 v8::Local<v8::Function>); | 133 v8::Local<v8::Function>); |
133 v8::MaybeLocal<v8::Value> generatorScopes(v8::Local<v8::Context>, | 134 v8::MaybeLocal<v8::Value> generatorScopes(v8::Local<v8::Context>, |
134 v8::Local<v8::Value>); | 135 v8::Local<v8::Value>); |
135 | 136 |
136 void asyncTaskCreated(void* task, void* parentTask); | |
137 void registerAsyncTaskIfNeeded(void* task); | 137 void registerAsyncTaskIfNeeded(void* task); |
138 | 138 |
| 139 int currentContextGroupId(); |
| 140 |
139 // v8::debug::DebugEventListener implementation. | 141 // v8::debug::DebugEventListener implementation. |
140 void PromiseEventOccurred(v8::debug::PromiseDebugActionType type, int id, | 142 void PromiseEventOccurred(v8::debug::PromiseDebugActionType type, |
141 int parentId) override; | 143 int id) override; |
| 144 void PromiseCreatedEvent(int id, int parentId, bool isBreakable) override; |
142 void ScriptCompiled(v8::Local<v8::debug::Script> script, | 145 void ScriptCompiled(v8::Local<v8::debug::Script> script, |
143 bool has_compile_error) override; | 146 bool has_compile_error) override; |
144 void BreakProgramRequested(v8::Local<v8::Context> paused_context, | 147 void BreakProgramRequested(v8::Local<v8::Context> paused_context, |
145 v8::Local<v8::Object> exec_state, | 148 v8::Local<v8::Object> exec_state, |
146 v8::Local<v8::Value> break_points_hit) override; | 149 v8::Local<v8::Value> break_points_hit) override; |
147 void ExceptionThrown(v8::Local<v8::Context> paused_context, | 150 void ExceptionThrown(v8::Local<v8::Context> paused_context, |
148 v8::Local<v8::Object> exec_state, | 151 v8::Local<v8::Object> exec_state, |
149 v8::Local<v8::Value> exception, | 152 v8::Local<v8::Value> exception, |
150 bool is_promise_rejection, bool is_uncaught) override; | 153 bool is_promise_rejection, bool is_uncaught) override; |
151 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, | 154 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, |
(...skipping 20 matching lines...) Expand all Loading... |
172 std::map<int, void*> m_idToTask; | 175 std::map<int, void*> m_idToTask; |
173 std::unordered_map<void*, int> m_taskToId; | 176 std::unordered_map<void*, int> m_taskToId; |
174 int m_lastTaskId; | 177 int m_lastTaskId; |
175 protocol::HashSet<void*> m_recurringTasks; | 178 protocol::HashSet<void*> m_recurringTasks; |
176 int m_maxAsyncCallStackDepth; | 179 int m_maxAsyncCallStackDepth; |
177 std::vector<void*> m_currentTasks; | 180 std::vector<void*> m_currentTasks; |
178 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 181 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
179 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 182 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
180 protocol::HashMap<void*, void*> m_parentTask; | 183 protocol::HashMap<void*, void*> m_parentTask; |
181 | 184 |
| 185 void* m_currentCreatedAsyncTask = nullptr; |
| 186 protocol::HashSet<void*> m_asyncTasksWithScheduledBreak; |
| 187 |
182 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; | 188 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; |
183 | 189 |
184 WasmTranslation m_wasmTranslation; | 190 WasmTranslation m_wasmTranslation; |
185 | 191 |
186 DISALLOW_COPY_AND_ASSIGN(V8Debugger); | 192 DISALLOW_COPY_AND_ASSIGN(V8Debugger); |
187 }; | 193 }; |
188 | 194 |
189 } // namespace v8_inspector | 195 } // namespace v8_inspector |
190 | 196 |
191 #endif // V8_INSPECTOR_V8DEBUGGER_H_ | 197 #endif // V8_INSPECTOR_V8DEBUGGER_H_ |
OLD | NEW |