| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_V8DEBUGGERAGENTIMPL_H_ | 5 #ifndef V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
| 6 #define V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ | 6 #define V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 std::unique_ptr<protocol::DictionaryValue> data); | 127 std::unique_ptr<protocol::DictionaryValue> data); |
| 128 | 128 |
| 129 void reset(); | 129 void reset(); |
| 130 | 130 |
| 131 // Interface for V8InspectorImpl | 131 // Interface for V8InspectorImpl |
| 132 void didPause(int contextId, v8::Local<v8::Value> exception, | 132 void didPause(int contextId, v8::Local<v8::Value> exception, |
| 133 const std::vector<String16>& hitBreakpoints, | 133 const std::vector<String16>& hitBreakpoints, |
| 134 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); | 134 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); |
| 135 void didContinue(); | 135 void didContinue(); |
| 136 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); | 136 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); |
| 137 void willExecuteScript(int scriptId); | |
| 138 void didExecuteScript(); | |
| 139 | 137 |
| 140 bool isFunctionBlackboxed(const String16& scriptId, | 138 bool isFunctionBlackboxed(const String16& scriptId, |
| 141 const v8::debug::Location& start, | 139 const v8::debug::Location& start, |
| 142 const v8::debug::Location& end); | 140 const v8::debug::Location& end); |
| 143 | 141 |
| 144 bool skipAllPauses() const { return m_skipAllPauses; } | 142 bool skipAllPauses() const { return m_skipAllPauses; } |
| 145 | 143 |
| 146 v8::Isolate* isolate() { return m_isolate; } | 144 v8::Isolate* isolate() { return m_isolate; } |
| 147 | 145 |
| 148 bool shouldBreakInScheduledAsyncTask(); | 146 bool shouldBreakInScheduledAsyncTask(); |
| 149 | 147 |
| 150 private: | 148 private: |
| 151 void enableImpl(); | 149 void enableImpl(); |
| 152 | 150 |
| 153 void schedulePauseOnNextStatementIfSteppingInto(); | |
| 154 | |
| 155 Response currentCallFrames( | 151 Response currentCallFrames( |
| 156 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); | 152 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); |
| 157 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); | 153 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); |
| 158 | 154 |
| 159 void changeJavaScriptRecursionLevel(int step); | |
| 160 | |
| 161 void setPauseOnExceptionsImpl(int); | 155 void setPauseOnExceptionsImpl(int); |
| 162 | 156 |
| 163 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( | 157 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( |
| 164 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource, | 158 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource, |
| 165 const String16& hint); | 159 const String16& hint); |
| 166 void removeBreakpointImpl(const String16& breakpointId); | 160 void removeBreakpointImpl(const String16& breakpointId); |
| 167 void clearBreakDetails(); | 161 void clearBreakDetails(); |
| 168 | 162 |
| 169 void internalSetAsyncCallStackDepth(int); | 163 void internalSetAsyncCallStackDepth(int); |
| 170 void increaseCachedSkipStackGeneration(); | 164 void increaseCachedSkipStackGeneration(); |
| 171 | 165 |
| 172 Response setBlackboxPattern(const String16& pattern); | 166 Response setBlackboxPattern(const String16& pattern); |
| 173 void resetBlackboxedStateCache(); | 167 void resetBlackboxedStateCache(); |
| 174 | 168 |
| 175 bool isPaused() const; | 169 bool isPaused() const; |
| 176 | 170 |
| 177 using ScriptsMap = | 171 using ScriptsMap = |
| 178 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; | 172 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; |
| 179 using BreakpointIdToDebuggerBreakpointIdsMap = | 173 using BreakpointIdToDebuggerBreakpointIdsMap = |
| 180 protocol::HashMap<String16, std::vector<String16>>; | 174 protocol::HashMap<String16, std::vector<String16>>; |
| 181 using DebugServerBreakpointToBreakpointIdAndSourceMap = | 175 using DebugServerBreakpointToBreakpointIdAndSourceMap = |
| 182 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; | 176 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; |
| 183 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; | 177 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; |
| 184 | 178 |
| 185 enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut }; | |
| 186 | |
| 187 V8InspectorImpl* m_inspector; | 179 V8InspectorImpl* m_inspector; |
| 188 V8Debugger* m_debugger; | 180 V8Debugger* m_debugger; |
| 189 V8InspectorSessionImpl* m_session; | 181 V8InspectorSessionImpl* m_session; |
| 190 bool m_enabled; | 182 bool m_enabled; |
| 191 protocol::DictionaryValue* m_state; | 183 protocol::DictionaryValue* m_state; |
| 192 protocol::Debugger::Frontend m_frontend; | 184 protocol::Debugger::Frontend m_frontend; |
| 193 v8::Isolate* m_isolate; | 185 v8::Isolate* m_isolate; |
| 194 JavaScriptCallFrames m_pausedCallFrames; | 186 JavaScriptCallFrames m_pausedCallFrames; |
| 195 ScriptsMap m_scripts; | 187 ScriptsMap m_scripts; |
| 196 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; | 188 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; |
| 197 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 189 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
| 198 String16 m_continueToLocationBreakpointId; | 190 String16 m_continueToLocationBreakpointId; |
| 199 | 191 |
| 200 using BreakReason = | 192 using BreakReason = |
| 201 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; | 193 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; |
| 202 std::vector<BreakReason> m_breakReason; | 194 std::vector<BreakReason> m_breakReason; |
| 203 | 195 |
| 204 void pushBreakDetails( | 196 void pushBreakDetails( |
| 205 const String16& breakReason, | 197 const String16& breakReason, |
| 206 std::unique_ptr<protocol::DictionaryValue> breakAuxData); | 198 std::unique_ptr<protocol::DictionaryValue> breakAuxData); |
| 207 void popBreakDetails(); | 199 void popBreakDetails(); |
| 208 | 200 |
| 209 DebuggerStep m_scheduledDebuggerStep; | |
| 210 bool m_javaScriptPauseScheduled; | 201 bool m_javaScriptPauseScheduled; |
| 211 | |
| 212 int m_recursionLevelForStepOut; | |
| 213 bool m_skipAllPauses = false; | 202 bool m_skipAllPauses = false; |
| 214 | 203 |
| 215 std::unique_ptr<V8Regex> m_blackboxPattern; | 204 std::unique_ptr<V8Regex> m_blackboxPattern; |
| 216 protocol::HashMap<String16, std::vector<std::pair<int, int>>> | 205 protocol::HashMap<String16, std::vector<std::pair<int, int>>> |
| 217 m_blackboxedPositions; | 206 m_blackboxedPositions; |
| 218 | 207 |
| 219 std::unique_ptr<ScheduleStepIntoAsyncCallback> m_stepIntoAsyncCallback; | 208 std::unique_ptr<ScheduleStepIntoAsyncCallback> m_stepIntoAsyncCallback; |
| 220 | 209 |
| 221 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); | 210 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); |
| 222 }; | 211 }; |
| 223 | 212 |
| 224 } // namespace v8_inspector | 213 } // namespace v8_inspector |
| 225 | 214 |
| 226 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ | 215 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
| OLD | NEW |