Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: src/inspector/v8-debugger.h

Issue 2655253004: [inspector] introduced stepIntoAsync for chained callbacks (Closed)
Patch Set: fixed async/await and added tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/inspector/js_protocol.json ('k') | src/inspector/v8-debugger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
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 void stepOverStatement(); 49 void stepOverStatement();
50 void stepOutOfFunction(); 50 void stepOutOfFunction();
51 Response stepIntoScheduledCallback();
52 bool stepIntoScheduledCallbackAvailable();
51 53
52 Response setScriptSource( 54 Response setScriptSource(
53 const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun, 55 const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun,
54 protocol::Maybe<protocol::Runtime::ExceptionDetails>*, 56 protocol::Maybe<protocol::Runtime::ExceptionDetails>*,
55 JavaScriptCallFrames* newCallFrames, protocol::Maybe<bool>* stackChanged, 57 JavaScriptCallFrames* newCallFrames, protocol::Maybe<bool>* stackChanged,
56 bool* compileError); 58 bool* compileError);
57 JavaScriptCallFrames currentCallFrames(int limit = 0); 59 JavaScriptCallFrames currentCallFrames(int limit = 0);
58 60
59 // Each script inherits debug data from v8::Context where it has been 61 // Each script inherits debug data from v8::Context where it has been
60 // compiled. 62 // compiled.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ScopeTargetKind); 124 ScopeTargetKind);
123 125
124 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, 126 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>,
125 v8::Local<v8::Function>); 127 v8::Local<v8::Function>);
126 v8::MaybeLocal<v8::Value> generatorScopes(v8::Local<v8::Context>, 128 v8::MaybeLocal<v8::Value> generatorScopes(v8::Local<v8::Context>,
127 v8::Local<v8::Value>); 129 v8::Local<v8::Value>);
128 130
129 void asyncTaskCreated(void* task, void* parentTask); 131 void asyncTaskCreated(void* task, void* parentTask);
130 void registerAsyncTaskIfNeeded(void* task); 132 void registerAsyncTaskIfNeeded(void* task);
131 133
134 void continueProgramImpl();
135
132 // v8::debug::DebugEventListener implementation. 136 // v8::debug::DebugEventListener implementation.
133 void PromiseEventOccurred(v8::debug::PromiseDebugActionType type, int id, 137 void PromiseEventOccurred(v8::Local<v8::Context> context,
134 int parentId) override; 138 v8::debug::PromiseDebugActionType type, int id,
139 int parentId, bool breakable) override;
135 void ScriptCompiled(v8::Local<v8::debug::Script> script, 140 void ScriptCompiled(v8::Local<v8::debug::Script> script,
136 bool has_compile_error) override; 141 bool has_compile_error) override;
137 void BreakProgramRequested(v8::Local<v8::Context> paused_context, 142 void BreakProgramRequested(v8::Local<v8::Context> paused_context,
138 v8::Local<v8::Object> exec_state, 143 v8::Local<v8::Object> exec_state,
139 v8::Local<v8::Value> break_points_hit) override; 144 v8::Local<v8::Value> break_points_hit) override;
140 void ExceptionThrown(v8::Local<v8::Context> paused_context, 145 void ExceptionThrown(v8::Local<v8::Context> paused_context,
141 v8::Local<v8::Object> exec_state, 146 v8::Local<v8::Object> exec_state,
142 v8::Local<v8::Value> exception, 147 v8::Local<v8::Value> exception,
143 v8::Local<v8::Value> promise, bool is_uncaught) override; 148 v8::Local<v8::Value> promise, bool is_uncaught) override;
144 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, 149 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script,
145 const v8::debug::Location& start, 150 const v8::debug::Location& start,
146 const v8::debug::Location& end) override; 151 const v8::debug::Location& end) override;
147 152
153 int currentContextGroupId();
154 void steppingOnPromiseEvent(v8::Local<v8::Context> context,
155 v8::debug::PromiseDebugActionType type,
156 void* task, void* parentPtr);
157
148 v8::Isolate* m_isolate; 158 v8::Isolate* m_isolate;
149 V8InspectorImpl* m_inspector; 159 V8InspectorImpl* m_inspector;
150 int m_enableCount; 160 int m_enableCount;
151 bool m_breakpointsActivated; 161 bool m_breakpointsActivated;
152 v8::Global<v8::Object> m_debuggerScript; 162 v8::Global<v8::Object> m_debuggerScript;
153 v8::Global<v8::Context> m_debuggerContext; 163 v8::Global<v8::Context> m_debuggerContext;
154 v8::Local<v8::Object> m_executionState; 164 v8::Local<v8::Object> m_executionState;
155 v8::Local<v8::Context> m_pausedContext; 165 v8::Local<v8::Context> m_pausedContext;
156 bool m_runningNestedMessageLoop; 166 bool m_runningNestedMessageLoop;
157 int m_ignoreScriptParsedEventsCounter; 167 int m_ignoreScriptParsedEventsCounter;
158 bool m_scheduledOOMBreak = false; 168 bool m_scheduledOOMBreak = false;
159 169
160 using AsyncTaskToStackTrace = 170 using AsyncTaskToStackTrace =
161 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>; 171 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>;
162 AsyncTaskToStackTrace m_asyncTaskStacks; 172 AsyncTaskToStackTrace m_asyncTaskStacks;
163 AsyncTaskToStackTrace m_asyncTaskCreationStacks; 173 AsyncTaskToStackTrace m_asyncTaskCreationStacks;
164 int m_maxAsyncCallStacks; 174 int m_maxAsyncCallStacks;
165 std::map<int, void*> m_idToTask; 175 std::map<int, void*> m_idToTask;
166 std::unordered_map<void*, int> m_taskToId; 176 std::unordered_map<void*, int> m_taskToId;
167 int m_lastTaskId; 177 int m_lastTaskId;
168 protocol::HashSet<void*> m_recurringTasks; 178 protocol::HashSet<void*> m_recurringTasks;
169 int m_maxAsyncCallStackDepth; 179 int m_maxAsyncCallStackDepth;
170 std::vector<void*> m_currentTasks; 180 std::vector<void*> m_currentTasks;
171 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; 181 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks;
172 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; 182 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap;
173 protocol::HashMap<void*, void*> m_parentTask; 183 protocol::HashMap<void*, void*> m_parentTask;
184 protocol::HashSet<void*> m_tasksWithScheduledBreak;
185 void* m_createdPromiseTask = nullptr;
174 186
175 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; 187 v8::debug::ExceptionBreakState m_pauseOnExceptionsState;
176 188
177 WasmTranslation m_wasmTranslation; 189 WasmTranslation m_wasmTranslation;
178 190
179 DISALLOW_COPY_AND_ASSIGN(V8Debugger); 191 DISALLOW_COPY_AND_ASSIGN(V8Debugger);
180 }; 192 };
181 193
182 } // namespace v8_inspector 194 } // namespace v8_inspector
183 195
184 #endif // V8_INSPECTOR_V8DEBUGGER_H_ 196 #endif // V8_INSPECTOR_V8DEBUGGER_H_
OLDNEW
« no previous file with comments | « src/inspector/js_protocol.json ('k') | src/inspector/v8-debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698