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 75 matching lines...) Loading... |
86 void asyncTaskFinished(void* task); | 86 void asyncTaskFinished(void* task); |
87 void allAsyncTasksCanceled(); | 87 void allAsyncTasksCanceled(); |
88 | 88 |
89 void muteScriptParsedEvents(); | 89 void muteScriptParsedEvents(); |
90 void unmuteScriptParsedEvents(); | 90 void unmuteScriptParsedEvents(); |
91 | 91 |
92 V8InspectorImpl* inspector() { return m_inspector; } | 92 V8InspectorImpl* inspector() { return m_inspector; } |
93 | 93 |
94 WasmTranslation* wasmTranslation() { return &m_wasmTranslation; } | 94 WasmTranslation* wasmTranslation() { return &m_wasmTranslation; } |
95 | 95 |
| 96 void setMaxAsyncTaskStacksForTest(int limit) { m_maxAsyncCallStacks = limit; } |
| 97 |
96 private: | 98 private: |
97 void compileDebuggerScript(); | 99 void compileDebuggerScript(); |
98 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, | 100 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, |
99 int argc, | 101 int argc, |
100 v8::Local<v8::Value> argv[]); | 102 v8::Local<v8::Value> argv[]); |
101 v8::Local<v8::Context> debuggerContext() const; | 103 v8::Local<v8::Context> debuggerContext() const; |
102 void clearBreakpoints(); | 104 void clearBreakpoints(); |
103 | 105 |
104 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 106 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
105 void handleProgramBreak(v8::Local<v8::Context> pausedContext, | 107 void handleProgramBreak(v8::Local<v8::Context> pausedContext, |
(...skipping 37 matching lines...) Loading... |
143 v8::Global<v8::Object> m_debuggerScript; | 145 v8::Global<v8::Object> m_debuggerScript; |
144 v8::Global<v8::Context> m_debuggerContext; | 146 v8::Global<v8::Context> m_debuggerContext; |
145 v8::Local<v8::Object> m_executionState; | 147 v8::Local<v8::Object> m_executionState; |
146 v8::Local<v8::Context> m_pausedContext; | 148 v8::Local<v8::Context> m_pausedContext; |
147 bool m_runningNestedMessageLoop; | 149 bool m_runningNestedMessageLoop; |
148 int m_ignoreScriptParsedEventsCounter; | 150 int m_ignoreScriptParsedEventsCounter; |
149 | 151 |
150 using AsyncTaskToStackTrace = | 152 using AsyncTaskToStackTrace = |
151 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>; | 153 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>; |
152 AsyncTaskToStackTrace m_asyncTaskStacks; | 154 AsyncTaskToStackTrace m_asyncTaskStacks; |
| 155 int m_maxAsyncCallStacks; |
| 156 std::map<int, void*> m_idToTask; |
| 157 std::unordered_map<void*, int> m_taskToId; |
| 158 int m_lastTaskId; |
153 protocol::HashSet<void*> m_recurringTasks; | 159 protocol::HashSet<void*> m_recurringTasks; |
154 int m_maxAsyncCallStackDepth; | 160 int m_maxAsyncCallStackDepth; |
155 std::vector<void*> m_currentTasks; | 161 std::vector<void*> m_currentTasks; |
156 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 162 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
157 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 163 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
158 | 164 |
159 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; | 165 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; |
160 | 166 |
161 WasmTranslation m_wasmTranslation; | 167 WasmTranslation m_wasmTranslation; |
162 | 168 |
163 DISALLOW_COPY_AND_ASSIGN(V8Debugger); | 169 DISALLOW_COPY_AND_ASSIGN(V8Debugger); |
164 }; | 170 }; |
165 | 171 |
166 } // namespace v8_inspector | 172 } // namespace v8_inspector |
167 | 173 |
168 #endif // V8_INSPECTOR_V8DEBUGGER_H_ | 174 #endif // V8_INSPECTOR_V8DEBUGGER_H_ |
OLD | NEW |