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/interface-types.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; |
22 class V8DebuggerScript; | 22 class V8DebuggerScript; |
23 class V8InspectorImpl; | 23 class V8InspectorImpl; |
24 class V8InspectorSessionImpl; | 24 class V8InspectorSessionImpl; |
25 class V8Regex; | 25 class V8Regex; |
26 class V8StackTraceImpl; | |
26 | 27 |
27 using protocol::Maybe; | 28 using protocol::Maybe; |
28 using protocol::Response; | 29 using protocol::Response; |
29 | 30 |
30 class V8DebuggerAgentImpl : public protocol::Debugger::Backend { | 31 class V8DebuggerAgentImpl : public protocol::Debugger::Backend { |
31 public: | 32 public: |
32 enum BreakpointSource { | 33 enum BreakpointSource { |
33 UserBreakpointSource, | 34 UserBreakpointSource, |
34 DebugCommandBreakpointSource, | 35 DebugCommandBreakpointSource, |
35 MonitorCommandBreakpointSource | 36 MonitorCommandBreakpointSource |
(...skipping 13 matching lines...) Expand all Loading... | |
49 int lineNumber, Maybe<String16> optionalURL, | 50 int lineNumber, Maybe<String16> optionalURL, |
50 Maybe<String16> optionalURLRegex, Maybe<int> optionalColumnNumber, | 51 Maybe<String16> optionalURLRegex, Maybe<int> optionalColumnNumber, |
51 Maybe<String16> optionalCondition, String16*, | 52 Maybe<String16> optionalCondition, String16*, |
52 std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) | 53 std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) |
53 override; | 54 override; |
54 Response setBreakpoint( | 55 Response setBreakpoint( |
55 std::unique_ptr<protocol::Debugger::Location>, | 56 std::unique_ptr<protocol::Debugger::Location>, |
56 Maybe<String16> optionalCondition, String16*, | 57 Maybe<String16> optionalCondition, String16*, |
57 std::unique_ptr<protocol::Debugger::Location>* actualLocation) override; | 58 std::unique_ptr<protocol::Debugger::Location>* actualLocation) override; |
58 Response removeBreakpoint(const String16& breakpointId) override; | 59 Response removeBreakpoint(const String16& breakpointId) override; |
59 Response continueToLocation( | 60 Response continueToLocation(std::unique_ptr<protocol::Debugger::Location>, |
60 std::unique_ptr<protocol::Debugger::Location>) override; | 61 Maybe<String16> strategy) override; |
61 Response searchInContent( | 62 Response searchInContent( |
62 const String16& scriptId, const String16& query, | 63 const String16& scriptId, const String16& query, |
63 Maybe<bool> optionalCaseSensitive, Maybe<bool> optionalIsRegex, | 64 Maybe<bool> optionalCaseSensitive, Maybe<bool> optionalIsRegex, |
64 std::unique_ptr<protocol::Array<protocol::Debugger::SearchMatch>>*) | 65 std::unique_ptr<protocol::Array<protocol::Debugger::SearchMatch>>*) |
65 override; | 66 override; |
66 Response getPossibleBreakpoints( | 67 Response getPossibleBreakpoints( |
67 std::unique_ptr<protocol::Debugger::Location> start, | 68 std::unique_ptr<protocol::Debugger::Location> start, |
68 Maybe<protocol::Debugger::Location> end, Maybe<bool> restrictToFunction, | 69 Maybe<protocol::Debugger::Location> end, Maybe<bool> restrictToFunction, |
69 std::unique_ptr<protocol::Array<protocol::Debugger::BreakLocation>>* | 70 std::unique_ptr<protocol::Array<protocol::Debugger::BreakLocation>>* |
70 locations) override; | 71 locations) override; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 const std::vector<String16>& hitBreakpoints, | 133 const std::vector<String16>& hitBreakpoints, |
133 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); | 134 bool isPromiseRejection, bool isUncaught, bool isOOMBreak); |
134 void didContinue(); | 135 void didContinue(); |
135 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); | 136 void didParseSource(std::unique_ptr<V8DebuggerScript>, bool success); |
136 | 137 |
137 bool isFunctionBlackboxed(const String16& scriptId, | 138 bool isFunctionBlackboxed(const String16& scriptId, |
138 const v8::debug::Location& start, | 139 const v8::debug::Location& start, |
139 const v8::debug::Location& end); | 140 const v8::debug::Location& end); |
140 | 141 |
141 bool skipAllPauses() const { return m_skipAllPauses; } | 142 bool skipAllPauses() const { return m_skipAllPauses; } |
143 bool shouldIgnoreContinueToLocation(const String16& breakpointId); | |
dgozman
2017/05/15 17:01:26
This should reside in V8Debugger. It's very simila
kozy
2017/05/16 01:43:48
Done in separate CL.
| |
142 | 144 |
143 v8::Isolate* isolate() { return m_isolate; } | 145 v8::Isolate* isolate() { return m_isolate; } |
144 | 146 |
145 private: | 147 private: |
146 void enableImpl(); | 148 void enableImpl(); |
147 | 149 |
148 Response currentCallFrames( | 150 Response currentCallFrames( |
149 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); | 151 std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); |
150 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); | 152 std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); |
151 | 153 |
152 void setPauseOnExceptionsImpl(int); | 154 void setPauseOnExceptionsImpl(int); |
153 | 155 |
154 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( | 156 std::unique_ptr<protocol::Debugger::Location> resolveBreakpoint( |
155 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource, | 157 const String16& breakpointId, const ScriptBreakpoint&, BreakpointSource, |
156 const String16& hint); | 158 const String16& hint); |
157 void removeBreakpointImpl(const String16& breakpointId); | 159 void removeBreakpointImpl(const String16& breakpointId); |
158 void clearBreakDetails(); | 160 void clearBreakDetails(); |
161 void clearContinueToLocation(); | |
159 | 162 |
160 void internalSetAsyncCallStackDepth(int); | 163 void internalSetAsyncCallStackDepth(int); |
161 void increaseCachedSkipStackGeneration(); | 164 void increaseCachedSkipStackGeneration(); |
162 | 165 |
163 Response setBlackboxPattern(const String16& pattern); | 166 Response setBlackboxPattern(const String16& pattern); |
164 void resetBlackboxedStateCache(); | 167 void resetBlackboxedStateCache(); |
165 | 168 |
166 bool isPaused() const; | 169 bool isPaused() const; |
167 | 170 |
168 using ScriptsMap = | 171 using ScriptsMap = |
169 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; | 172 protocol::HashMap<String16, std::unique_ptr<V8DebuggerScript>>; |
170 using BreakpointIdToDebuggerBreakpointIdsMap = | 173 using BreakpointIdToDebuggerBreakpointIdsMap = |
171 protocol::HashMap<String16, std::vector<String16>>; | 174 protocol::HashMap<String16, std::vector<String16>>; |
172 using DebugServerBreakpointToBreakpointIdAndSourceMap = | 175 using DebugServerBreakpointToBreakpointIdAndSourceMap = |
173 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; | 176 protocol::HashMap<String16, std::pair<String16, BreakpointSource>>; |
174 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; | 177 using MuteBreakpoins = protocol::HashMap<String16, std::pair<String16, int>>; |
175 | 178 |
176 V8InspectorImpl* m_inspector; | 179 V8InspectorImpl* m_inspector; |
177 V8Debugger* m_debugger; | 180 V8Debugger* m_debugger; |
178 V8InspectorSessionImpl* m_session; | 181 V8InspectorSessionImpl* m_session; |
179 bool m_enabled; | 182 bool m_enabled; |
180 protocol::DictionaryValue* m_state; | 183 protocol::DictionaryValue* m_state; |
181 protocol::Debugger::Frontend m_frontend; | 184 protocol::Debugger::Frontend m_frontend; |
182 v8::Isolate* m_isolate; | 185 v8::Isolate* m_isolate; |
183 JavaScriptCallFrames m_pausedCallFrames; | 186 JavaScriptCallFrames m_pausedCallFrames; |
184 ScriptsMap m_scripts; | 187 ScriptsMap m_scripts; |
185 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; | 188 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds; |
186 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 189 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
187 String16 m_continueToLocationBreakpointId; | 190 String16 m_continueToLocationBreakpointId; |
191 String16 m_continueToLocationStrategy; | |
192 std::unique_ptr<V8StackTraceImpl> m_continueToLocationStack; | |
188 | 193 |
189 using BreakReason = | 194 using BreakReason = |
190 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; | 195 std::pair<String16, std::unique_ptr<protocol::DictionaryValue>>; |
191 std::vector<BreakReason> m_breakReason; | 196 std::vector<BreakReason> m_breakReason; |
192 | 197 |
193 void pushBreakDetails( | 198 void pushBreakDetails( |
194 const String16& breakReason, | 199 const String16& breakReason, |
195 std::unique_ptr<protocol::DictionaryValue> breakAuxData); | 200 std::unique_ptr<protocol::DictionaryValue> breakAuxData); |
196 void popBreakDetails(); | 201 void popBreakDetails(); |
197 | 202 |
198 bool m_skipAllPauses = false; | 203 bool m_skipAllPauses = false; |
199 | 204 |
200 std::unique_ptr<V8Regex> m_blackboxPattern; | 205 std::unique_ptr<V8Regex> m_blackboxPattern; |
201 protocol::HashMap<String16, std::vector<std::pair<int, int>>> | 206 protocol::HashMap<String16, std::vector<std::pair<int, int>>> |
202 m_blackboxedPositions; | 207 m_blackboxedPositions; |
203 | 208 |
204 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); | 209 DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl); |
205 }; | 210 }; |
206 | 211 |
207 } // namespace v8_inspector | 212 } // namespace v8_inspector |
208 | 213 |
209 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ | 214 #endif // V8_INSPECTOR_V8DEBUGGERAGENTIMPL_H_ |
OLD | NEW |