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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 using protocol::Response; | 27 using protocol::Response; |
28 | 28 |
29 class V8Debugger : public v8::debug::DebugDelegate { | 29 class V8Debugger : public v8::debug::DebugDelegate { |
30 public: | 30 public: |
31 V8Debugger(v8::Isolate*, V8InspectorImpl*); | 31 V8Debugger(v8::Isolate*, V8InspectorImpl*); |
32 ~V8Debugger(); | 32 ~V8Debugger(); |
33 | 33 |
34 bool enabled() const; | 34 bool enabled() const; |
35 | 35 |
36 String16 setBreakpoint(const ScriptBreakpoint&, int* actualLineNumber, | |
37 int* actualColumnNumber); | |
38 void removeBreakpoint(const String16& breakpointId); | |
39 void setBreakpointsActivated(bool); | 36 void setBreakpointsActivated(bool); |
40 bool breakpointsActivated() const { return m_breakpointsActivated; } | 37 bool breakpointsActivated() const { return m_breakpointsActivated; } |
41 | 38 |
42 v8::debug::ExceptionBreakState getPauseOnExceptionsState(); | 39 v8::debug::ExceptionBreakState getPauseOnExceptionsState(); |
43 void setPauseOnExceptionsState(v8::debug::ExceptionBreakState); | 40 void setPauseOnExceptionsState(v8::debug::ExceptionBreakState); |
44 void setPauseOnNextStatement(bool); | 41 void setPauseOnNextStatement(bool); |
45 bool canBreakProgram(); | 42 bool canBreakProgram(); |
46 void breakProgram(); | 43 void breakProgram(); |
47 void continueProgram(); | 44 void continueProgram(); |
48 void stepIntoStatement(); | 45 void stepIntoStatement(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 91 |
95 void setMaxAsyncTaskStacksForTest(int limit) { m_maxAsyncCallStacks = limit; } | 92 void setMaxAsyncTaskStacksForTest(int limit) { m_maxAsyncCallStacks = limit; } |
96 | 93 |
97 private: | 94 private: |
98 void compileDebuggerScript(); | 95 void compileDebuggerScript(); |
99 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, | 96 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, |
100 int argc, | 97 int argc, |
101 v8::Local<v8::Value> argv[], | 98 v8::Local<v8::Value> argv[], |
102 bool catchExceptions); | 99 bool catchExceptions); |
103 v8::Local<v8::Context> debuggerContext() const; | 100 v8::Local<v8::Context> debuggerContext() const; |
104 void clearBreakpoints(); | |
105 | 101 |
106 static void v8OOMCallback(void* data); | 102 static void v8OOMCallback(void* data); |
107 | 103 |
108 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 104 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
109 void handleProgramBreak(v8::Local<v8::Context> pausedContext, | 105 void handleProgramBreak( |
110 v8::Local<v8::Object> executionState, | 106 v8::Local<v8::Context> pausedContext, |
111 v8::Local<v8::Value> exception, | 107 v8::Local<v8::Object> executionState, v8::Local<v8::Value> exception, |
112 v8::Local<v8::Array> hitBreakpoints, | 108 const v8::PersistentValueVector<v8::debug::BreakPoint>& hitBreakpoints, |
113 bool isPromiseRejection = false, | 109 bool isPromiseRejection = false, bool isUncaught = false); |
114 bool isUncaught = false); | |
115 | 110 |
116 enum ScopeTargetKind { | 111 enum ScopeTargetKind { |
117 FUNCTION, | 112 FUNCTION, |
118 GENERATOR, | 113 GENERATOR, |
119 }; | 114 }; |
120 v8::MaybeLocal<v8::Value> getTargetScopes(v8::Local<v8::Context>, | 115 v8::MaybeLocal<v8::Value> getTargetScopes(v8::Local<v8::Context>, |
121 v8::Local<v8::Value>, | 116 v8::Local<v8::Value>, |
122 ScopeTargetKind); | 117 ScopeTargetKind); |
123 | 118 |
124 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, | 119 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Context>, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; | 170 v8::debug::ExceptionBreakState m_pauseOnExceptionsState; |
176 | 171 |
177 WasmTranslation m_wasmTranslation; | 172 WasmTranslation m_wasmTranslation; |
178 | 173 |
179 DISALLOW_COPY_AND_ASSIGN(V8Debugger); | 174 DISALLOW_COPY_AND_ASSIGN(V8Debugger); |
180 }; | 175 }; |
181 | 176 |
182 } // namespace v8_inspector | 177 } // namespace v8_inspector |
183 | 178 |
184 #endif // V8_INSPECTOR_V8DEBUGGER_H_ | 179 #endif // V8_INSPECTOR_V8DEBUGGER_H_ |
OLD | NEW |