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" |
11 #include "src/debug/interface-types.h" | 11 #include "src/debug/debug-interface.h" |
12 #include "src/inspector/java-script-call-frame.h" | 12 #include "src/inspector/java-script-call-frame.h" |
13 #include "src/inspector/protocol/Debugger.h" | 13 #include "src/inspector/protocol/Debugger.h" |
14 #include "src/inspector/protocol/Forward.h" | 14 #include "src/inspector/protocol/Forward.h" |
15 | 15 |
16 namespace v8_inspector { | 16 namespace v8_inspector { |
17 | 17 |
18 struct ScriptBreakpoint; | 18 struct ScriptBreakpoint; |
19 class JavaScriptCallFrame; | 19 class JavaScriptCallFrame; |
20 class PromiseTracker; | 20 class PromiseTracker; |
21 class V8Debugger; | 21 class V8Debugger; |
(...skipping 98 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 void didPause(int contextId, v8::Local<v8::Value> exception, | 130 void didPause( |
131 const std::vector<String16>& hitBreakpoints, | 131 int contextId, v8::Local<v8::Value> exception, |
132 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); | 132 const v8::PersistentValueVector<v8::debug::BreakPoint>& hitBreakpoints, |
| 133 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); |
133 void didContinue(); | 134 void didContinue(); |
134 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); | 135 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); |
135 void willExecuteScript(int scriptId); | 136 void willExecuteScript(int scriptId); |
136 void didExecuteScript(); | 137 void didExecuteScript(); |
137 | 138 |
138 bool isFunctionBlackboxed(const String16& scriptId, | 139 bool isFunctionBlackboxed(const String16& scriptId, |
139 const v8::debug::Location& start, | 140 const v8::debug::Location& start, |
140 const v8::debug::Location& end); | 141 const v8::debug::Location& end); |
141 | 142 |
142 bool skipAllPauses() const { return m_skipAllPauses; } | 143 bool skipAllPauses() const { return m_skipAllPauses; } |
(...skipping 11 matching lines...) Expand all Loading... |
154 | 155 |
155 void changeJavaScriptRecursionLevel(int step); | 156 void changeJavaScriptRecursionLevel(int step); |
156 | 157 |
157 void setPauseOnExceptionsImpl(int); | 158 void setPauseOnExceptionsImpl(int); |
158 | 159 |
159 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( | 160 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( |
160 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource); | 161 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource); |
161 void removeBreakpointImpl(const String16& breakpointId); | 162 void removeBreakpointImpl(const String16& breakpointId); |
162 void clearBreakDetails(); | 163 void clearBreakDetails(); |
163 | 164 |
164 void internalSetAsyncCallStackDepth(int); | |
165 void increaseCachedSkipStackGeneration(); | |
166 | |
167 Response setBlackboxPattern(const String16& pattern); | 165 Response setBlackboxPattern(const String16& pattern); |
168 void resetBlackboxedStateCache(); | 166 void resetBlackboxedStateCache(); |
169 | 167 |
170 bool isPaused() const; | 168 bool isPaused() const; |
171 | 169 |
172 using ScriptsMap = | 170 using ScriptsMap = |
173 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; | 171 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; |
174 using BreakpointIdToDebuggerBreakpointIdsMap = | 172 |
175 protocol::HashMap<String16, std::vector<String16>>; | 173 using BreakpointIdToBreakpoints = |
176 using DebugServerBreakpointToBreakpointIdAndSourceMap = | 174 protocol::HashMap<String16, |
177 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; | 175 std::vector<v8::Global<v8::debug::BreakPoint>>>; |
178 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; | 176 using BreakpointIdToSource = protocol::HashMap<String16, BreakpointSource>; |
179 | 177 |
180 enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut }; | 178 enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut }; |
181 | 179 |
182 V8InspectorImpl* m_inspector; | 180 V8InspectorImpl* m_inspector; |
183 V8Debugger* m_debugger; | 181 V8Debugger* m_debugger; |
184 V8InspectorSessionImpl* m_session; | 182 V8InspectorSessionImpl* m_session; |
185 bool m_enabled; | 183 bool m_enabled; |
186 protocol::DictionaryValue* m_state; | 184 protocol::DictionaryValue* m_state; |
187 protocol::Debugger::Frontend m_frontend; | 185 protocol::Debugger::Frontend m_frontend; |
188 v8::Isolate* m_isolate; | 186 v8::Isolate* m_isolate; |
189 JavaScriptCallFrames m_pausedCallFrames; | 187 JavaScriptCallFrames m_pausedCallFrames; |
190 ScriptsMap m_scripts; | 188 ScriptsMap m_scripts; |
191 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; | 189 |
192 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 190 BreakpointIdToBreakpoints m_idToBreakpoints; |
193 String16 m_continueToLocationBreakpointId; | 191 BreakpointIdToSource m_breakpointIdToSource; |
| 192 |
| 193 v8::Global<v8::debug::BreakPoint> m_continueToLocationBreakpoint; |
194 | 194 |
195 using BreakReason = | 195 using BreakReason = |
196 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; | 196 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; |
197 std::vector<BreakReason> m_breakReason; | 197 std::vector<BreakReason> m_breakReason; |
198 | 198 |
199 void pushBreakDetails( | 199 void pushBreakDetails( |
200 const String16& breakReason, | 200 const String16& breakReason, |
201 std::unique_ptr<protocol::DictionaryValue> breakAuxData); | 201 std::unique_ptr<protocol::DictionaryValue> breakAuxData); |
202 void popBreakDetails(); | 202 void popBreakDetails(); |
203 | 203 |
204 DebuggerStep m_scheduledDebuggerStep; | 204 DebuggerStep m_scheduledDebuggerStep; |
205 bool m_javaScriptPauseScheduled; | 205 bool m_javaScriptPauseScheduled; |
206 | 206 |
207 int m_recursionLevelForStepOut; | 207 int m_recursionLevelForStepOut; |
208 bool m_skipAllPauses = false; | 208 bool m_skipAllPauses = false; |
209 | 209 |
210 std::unique_ptr<V8Regex> m_blackboxPattern; | 210 std::unique_ptr<V8Regex> m_blackboxPattern; |
211 protocol::HashMap<String16, std::vector<std::pair<int, int>>> | 211 protocol::HashMap<String16, std::vector<std::pair<int, int>>> |
212 m_blackboxedPositions; | 212 m_blackboxedPositions; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); | 214 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); |
215 }; | 215 }; |
216 | 216 |
217 } // namespace v8_inspector | 217 } // namespace v8_inspector |
218 | 218 |
219 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ | 219 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
OLD | NEW |