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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 std::unique_ptr<protocol::DictionaryValue> data); | 120 std::unique_ptr<protocol::DictionaryValue> data); |
121 void cancelPauseOnNextStatement(); | 121 void cancelPauseOnNextStatement(); |
122 void breakProgram(const String16& breakReason, | 122 void breakProgram(const String16& breakReason, |
123 std::unique_ptr<protocol::DictionaryValue> data); | 123 std::unique_ptr<protocol::DictionaryValue> data); |
124 void breakProgramOnException(const String16& breakReason, | 124 void breakProgramOnException(const String16& breakReason, |
125 std::unique_ptr<protocol::DictionaryValue> data); | 125 std::unique_ptr<protocol::DictionaryValue> data); |
126 | 126 |
127 void reset(); | 127 void reset(); |
128 | 128 |
129 // Interface for V8InspectorImpl | 129 // Interface for V8InspectorImpl |
130 bool didPause(v8::Local<v8::Context>, v8::Local<v8::Value> exception, | 130 void didPause(int contextId, v8::Local<v8::Value> exception, |
131 const std::vector<String16>& hitBreakpoints, | 131 const std::vector<String16>& hitBreakpoints, |
132 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); | 132 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); |
133 void didContinue(); | 133 void didContinue(); |
134 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); | 134 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); |
135 void willExecuteScript(int scriptId); | 135 void willExecuteScript(int scriptId); |
136 void didExecuteScript(); | 136 void didExecuteScript(); |
137 | 137 |
138 bool isFunctionBlackboxed(const String16& scriptId, | 138 bool isFunctionBlackboxed(const String16& scriptId, |
139 const v8::debug::Location& start, | 139 const v8::debug::Location& start, |
140 const v8::debug::Location& end); | 140 const v8::debug::Location& end); |
141 | 141 |
| 142 bool skipAllPauses() const { return m_skipAllPauses; } |
| 143 |
142 v8::Isolate* isolate() { return m_isolate; } | 144 v8::Isolate* isolate() { return m_isolate; } |
143 | 145 |
144 private: | 146 private: |
145 void enableImpl(); | 147 void enableImpl(); |
146 | 148 |
147 void schedulePauseOnNextStatementIfSteppingInto(); | 149 void schedulePauseOnNextStatementIfSteppingInto(); |
148 | 150 |
149 Response currentCallFrames( | 151 Response currentCallFrames( |
150 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); | 152 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); |
151 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); | 153 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); |
152 | 154 |
153 void changeJavaScriptRecursionLevel(int step); | 155 void changeJavaScriptRecursionLevel(int step); |
154 | 156 |
155 void setPauseOnExceptionsImpl(int); | 157 void setPauseOnExceptionsImpl(int); |
156 | 158 |
157 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( | 159 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( |
158 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource); | 160 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource); |
159 void removeBreakpointImpl(const String16& breakpointId); | 161 void removeBreakpointImpl(const String16& breakpointId); |
160 void clearBreakDetails(); | 162 void clearBreakDetails(); |
161 | 163 |
162 void internalSetAsyncCallStackDepth(int); | 164 void internalSetAsyncCallStackDepth(int); |
163 void increaseCachedSkipStackGeneration(); | 165 void increaseCachedSkipStackGeneration(); |
164 | 166 |
165 Response setBlackboxPattern(const String16& pattern); | 167 Response setBlackboxPattern(const String16& pattern); |
166 void resetBlackboxedStateCache(); | 168 void resetBlackboxedStateCache(); |
167 | 169 |
| 170 bool isPaused() const; |
| 171 |
168 using ScriptsMap = | 172 using ScriptsMap = |
169 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; | 173 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; |
170 using BreakpointIdToDebuggerBreakpointIdsMap = | 174 using BreakpointIdToDebuggerBreakpointIdsMap = |
171 protocol::HashMap<String16, std::vector<String16>>; | 175 protocol::HashMap<String16, std::vector<String16>>; |
172 using DebugServerBreakpointToBreakpointIdAndSourceMap = | 176 using DebugServerBreakpointToBreakpointIdAndSourceMap = |
173 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; | 177 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; |
174 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; | 178 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; |
175 | 179 |
176 enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut }; | 180 enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut }; |
177 | 181 |
178 V8InspectorImpl* m_inspector; | 182 V8InspectorImpl* m_inspector; |
179 V8Debugger* m_debugger; | 183 V8Debugger* m_debugger; |
180 V8InspectorSessionImpl* m_session; | 184 V8InspectorSessionImpl* m_session; |
181 bool m_enabled; | 185 bool m_enabled; |
182 protocol::DictionaryValue* m_state; | 186 protocol::DictionaryValue* m_state; |
183 protocol::Debugger::Frontend m_frontend; | 187 protocol::Debugger::Frontend m_frontend; |
184 v8::Isolate* m_isolate; | 188 v8::Isolate* m_isolate; |
185 v8::Global<v8::Context> m_pausedContext; | |
186 JavaScriptCallFrames m_pausedCallFrames; | 189 JavaScriptCallFrames m_pausedCallFrames; |
187 ScriptsMap m_scripts; | 190 ScriptsMap m_scripts; |
188 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; | 191 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; |
189 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 192 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
190 String16 m_continueToLocationBreakpointId; | 193 String16 m_continueToLocationBreakpointId; |
191 String16 m_breakReason; | 194 String16 m_breakReason; |
192 std::unique_ptr<protocol::DictionaryValue> m_breakAuxData; | 195 std::unique_ptr<protocol::DictionaryValue> m_breakAuxData; |
193 DebuggerStep m_scheduledDebuggerStep; | 196 DebuggerStep m_scheduledDebuggerStep; |
194 bool m_javaScriptPauseScheduled; | 197 bool m_javaScriptPauseScheduled; |
195 | 198 |
196 int m_recursionLevelForStepOut; | 199 int m_recursionLevelForStepOut; |
197 bool m_skipAllPauses; | 200 bool m_skipAllPauses = false; |
198 | 201 |
199 std::unique_ptr<V8Regex> m_blackboxPattern; | 202 std::unique_ptr<V8Regex> m_blackboxPattern; |
200 protocol::HashMap<String16, std::vector<std::pair<int, int>>> | 203 protocol::HashMap<String16, std::vector<std::pair<int, int>>> |
201 m_blackboxedPositions; | 204 m_blackboxedPositions; |
202 | 205 |
203 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); | 206 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); |
204 }; | 207 }; |
205 | 208 |
206 } // namespace v8_inspector | 209 } // namespace v8_inspector |
207 | 210 |
208 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ | 211 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
OLD | NEW |