| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void setMaxAsyncTaskStacksForTest(int limit) { m_maxAsyncCallStacks = limit; } | 96 void setMaxAsyncTaskStacksForTest(int limit) { m_maxAsyncCallStacks = limit; } |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 void compileDebuggerScript(); | 99 void compileDebuggerScript(); |
| 100 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, | 100 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, |
| 101 int argc, | 101 int argc, |
| 102 v8::Local<v8::Value> argv[]); | 102 v8::Local<v8::Value> argv[]); |
| 103 v8::Local<v8::Context> debuggerContext() const; | 103 v8::Local<v8::Context> debuggerContext() const; |
| 104 void clearBreakpoints(); | 104 void clearBreakpoints(); |
| 105 | 105 |
| 106 static void v8OOMCallback(void* data); |
| 107 |
| 106 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 108 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 107 void handleProgramBreak(v8::Local<v8::Context> pausedContext, | 109 void handleProgramBreak(v8::Local<v8::Context> pausedContext, |
| 108 v8::Local<v8::Object> executionState, | 110 v8::Local<v8::Object> executionState, |
| 109 v8::Local<v8::Value> exception, | 111 v8::Local<v8::Value> exception, |
| 110 v8::Local<v8::Array> hitBreakpoints, | 112 v8::Local<v8::Array> hitBreakpoints, |
| 111 bool isPromiseRejection = false, | 113 bool isPromiseRejection = false, |
| 112 bool isUncaught = false); | 114 bool isUncaught = false); |
| 113 static void v8DebugEventCallback(const v8::debug::EventDetails&); | 115 static void v8DebugEventCallback(const v8::debug::EventDetails&); |
| 114 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, | 116 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, |
| 115 const char* functionName); | 117 const char* functionName); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 142 v8::Isolate* m_isolate; | 144 v8::Isolate* m_isolate; |
| 143 V8InspectorImpl* m_inspector; | 145 V8InspectorImpl* m_inspector; |
| 144 int m_enableCount; | 146 int m_enableCount; |
| 145 bool m_breakpointsActivated; | 147 bool m_breakpointsActivated; |
| 146 v8::Global<v8::Object> m_debuggerScript; | 148 v8::Global<v8::Object> m_debuggerScript; |
| 147 v8::Global<v8::Context> m_debuggerContext; | 149 v8::Global<v8::Context> m_debuggerContext; |
| 148 v8::Local<v8::Object> m_executionState; | 150 v8::Local<v8::Object> m_executionState; |
| 149 v8::Local<v8::Context> m_pausedContext; | 151 v8::Local<v8::Context> m_pausedContext; |
| 150 bool m_runningNestedMessageLoop; | 152 bool m_runningNestedMessageLoop; |
| 151 int m_ignoreScriptParsedEventsCounter; | 153 int m_ignoreScriptParsedEventsCounter; |
| 154 bool m_scheduledOOMBreak = false; |
| 152 | 155 |
| 153 using AsyncTaskToStackTrace = | 156 using AsyncTaskToStackTrace = |
| 154 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>; | 157 protocol::HashMap<void*, std::unique_ptr<V8StackTraceImpl>>; |
| 155 AsyncTaskToStackTrace m_asyncTaskStacks; | 158 AsyncTaskToStackTrace m_asyncTaskStacks; |
| 156 int m_maxAsyncCallStacks; | 159 int m_maxAsyncCallStacks; |
| 157 std::map<int, void*> m_idToTask; | 160 std::map<int, void*> m_idToTask; |
| 158 std::unordered_map<void*, int> m_taskToId; | 161 std::unordered_map<void*, int> m_taskToId; |
| 159 int m_lastTaskId; | 162 int m_lastTaskId; |
| 160 protocol::HashSet<void*> m_recurringTasks; | 163 protocol::HashSet<void*> m_recurringTasks; |
| 161 int m_maxAsyncCallStackDepth; | 164 int m_maxAsyncCallStackDepth; |
| 162 std::vector<void*> m_currentTasks; | 165 std::vector<void*> m_currentTasks; |
| 163 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; | 166 std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; |
| 164 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 167 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
| 165 | 168 |
| 166 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; | 169 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; |
| 167 | 170 |
| 168 WasmTranslation m_wasmTranslation; | 171 WasmTranslation m_wasmTranslation; |
| 169 | 172 |
| 170 DISALLOW_COPY_AND_ASSIGN(V8Debugger); | 173 DISALLOW_COPY_AND_ASSIGN(V8Debugger); |
| 171 }; | 174 }; |
| 172 | 175 |
| 173 } // namespace v8_inspector | 176 } // namespace v8_inspector |
| 174 | 177 |
| 175 #endif // V8_INSPECTOR_V8DEBUGGER_H_ | 178 #endif // V8_INSPECTOR_V8DEBUGGER_H_ |
| OLD | NEW |