| 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" |
| 11 #include "src/debug/debug-interface.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/Forward.h" | 13 #include "src/inspector/protocol/Forward.h" |
| 14 #include "src/inspector/protocol/Runtime.h" | 14 #include "src/inspector/protocol/Runtime.h" |
| 15 #include "src/inspector/v8-debugger-script.h" | 15 #include "src/inspector/v8-debugger-script.h" |
| 16 | 16 |
| 17 #include "include/v8-inspector.h" | 17 #include "include/v8-inspector.h" |
| 18 | 18 |
| 19 namespace v8_inspector { | 19 namespace v8_inspector { |
| 20 | 20 |
| 21 struct ScriptBreakpoint; | 21 struct ScriptBreakpoint; |
| 22 class V8DebuggerAgentImpl; | 22 class V8DebuggerAgentImpl; |
| 23 class V8InspectorImpl; | 23 class V8InspectorImpl; |
| 24 class V8StackTraceImpl; | 24 class V8StackTraceImpl; |
| 25 | 25 |
| 26 using protocol::ErrorString; | 26 using protocol::Response; |
| 27 | 27 |
| 28 class V8Debugger { | 28 class V8Debugger { |
| 29 public: | 29 public: |
| 30 V8Debugger(v8::Isolate*, V8InspectorImpl*); | 30 V8Debugger(v8::Isolate*, V8InspectorImpl*); |
| 31 ~V8Debugger(); | 31 ~V8Debugger(); |
| 32 | 32 |
| 33 static int contextId(v8::Local<v8::Context>); | 33 static int contextId(v8::Local<v8::Context>); |
| 34 static int getGroupId(v8::Local<v8::Context>); | 34 static int getGroupId(v8::Local<v8::Context>); |
| 35 int markContext(const V8ContextInfo&); | 35 int markContext(const V8ContextInfo&); |
| 36 | 36 |
| 37 bool enabled() const; | 37 bool enabled() const; |
| 38 | 38 |
| 39 String16 setBreakpoint(const String16& sourceID, const ScriptBreakpoint&, | 39 String16 setBreakpoint(const String16& sourceID, const ScriptBreakpoint&, |
| 40 int* actualLineNumber, int* actualColumnNumber); | 40 int* actualLineNumber, int* actualColumnNumber); |
| 41 void removeBreakpoint(const String16& breakpointId); | 41 void removeBreakpoint(const String16& breakpointId); |
| 42 void setBreakpointsActivated(bool); | 42 void setBreakpointsActivated(bool); |
| 43 bool breakpointsActivated() const { return m_breakpointsActivated; } | 43 bool breakpointsActivated() const { return m_breakpointsActivated; } |
| 44 | 44 |
| 45 v8::DebugInterface::ExceptionBreakState getPauseOnExceptionsState(); | 45 v8::DebugInterface::ExceptionBreakState getPauseOnExceptionsState(); |
| 46 void setPauseOnExceptionsState(v8::DebugInterface::ExceptionBreakState); | 46 void setPauseOnExceptionsState(v8::DebugInterface::ExceptionBreakState); |
| 47 void setPauseOnNextStatement(bool); | 47 void setPauseOnNextStatement(bool); |
| 48 bool canBreakProgram(); | 48 bool canBreakProgram(); |
| 49 void breakProgram(); | 49 void breakProgram(); |
| 50 void continueProgram(); | 50 void continueProgram(); |
| 51 void stepIntoStatement(); | 51 void stepIntoStatement(); |
| 52 void stepOverStatement(); | 52 void stepOverStatement(); |
| 53 void stepOutOfFunction(); | 53 void stepOutOfFunction(); |
| 54 void clearStepping(); | 54 void clearStepping(); |
| 55 | 55 |
| 56 bool setScriptSource(const String16& sourceID, | 56 Response setScriptSource( |
| 57 v8::Local<v8::String> newSource, bool dryRun, | 57 const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun, |
| 58 ErrorString*, | 58 protocol::Maybe<protocol::Runtime::ExceptionDetails>*, |
| 59 protocol::Maybe<protocol::Runtime::ExceptionDetails>*, | 59 JavaScriptCallFrames* newCallFrames, protocol::Maybe<bool>* stackChanged, |
| 60 JavaScriptCallFrames* newCallFrames, | 60 bool* compileError); |
| 61 protocol::Maybe<bool>* stackChanged); | |
| 62 JavaScriptCallFrames currentCallFrames(int limit = 0); | 61 JavaScriptCallFrames currentCallFrames(int limit = 0); |
| 63 | 62 |
| 64 // Each script inherits debug data from v8::Context where it has been | 63 // Each script inherits debug data from v8::Context where it has been |
| 65 // compiled. | 64 // compiled. |
| 66 // Only scripts whose debug data matches |contextGroupId| will be reported. | 65 // Only scripts whose debug data matches |contextGroupId| will be reported. |
| 67 // Passing 0 will result in reporting all scripts. | 66 // Passing 0 will result in reporting all scripts. |
| 68 void getCompiledScripts(int contextGroupId, | 67 void getCompiledScripts(int contextGroupId, |
| 69 std::vector<std::unique_ptr<V8DebuggerScript>>&); | 68 std::vector<std::unique_ptr<V8DebuggerScript>>&); |
| 70 void enable(); | 69 void enable(); |
| 71 void disable(); | 70 void disable(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; | 147 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; |
| 149 | 148 |
| 150 v8::DebugInterface::ExceptionBreakState m_pauseOnExceptionsState; | 149 v8::DebugInterface::ExceptionBreakState m_pauseOnExceptionsState; |
| 151 | 150 |
| 152 DISALLOW_COPY_AND_ASSIGN(V8Debugger); | 151 DISALLOW_COPY_AND_ASSIGN(V8Debugger); |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 } // namespace v8_inspector | 154 } // namespace v8_inspector |
| 156 | 155 |
| 157 #endif // V8_INSPECTOR_V8DEBUGGER_H_ | 156 #endif // V8_INSPECTOR_V8DEBUGGER_H_ |
| OLD | NEW |