Index: src/inspector/v8-debugger.cc |
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc |
index a65cc738e34f2acc4e3f3fae9dc9acb847a1bac4..cf7dc2a2e0671d845fc33d89f7c8be1d9c6bdd85 100644 |
--- a/src/inspector/v8-debugger.cc |
+++ b/src/inspector/v8-debugger.cc |
@@ -194,6 +194,7 @@ void V8Debugger::disable() { |
if (--m_enableCount) return; |
DCHECK(enabled()); |
clearBreakpoints(); |
+ clearContinueToLocation(); |
m_debuggerScript.Reset(); |
m_debuggerContext.Reset(); |
allAsyncTasksCanceled(); |
@@ -411,6 +412,35 @@ void V8Debugger::scheduleStepIntoAsync( |
m_stepIntoAsyncCallback = std::move(callback); |
} |
+Response V8Debugger::continueToLocation( |
+ int targetContextGroupId, |
+ std::unique_ptr<protocol::Debugger::Location> location) { |
+ DCHECK(isPaused()); |
+ DCHECK(!m_executionState.IsEmpty()); |
+ DCHECK(targetContextGroupId); |
+ m_targetContextGroupId = targetContextGroupId; |
+ ScriptBreakpoint breakpoint(location->getScriptId(), |
+ location->getLineNumber(), |
+ location->getColumnNumber(0), String16()); |
+ int lineNumber = 0; |
+ int columnNumber = 0; |
+ m_continueToLocationBreakpointId = |
+ setBreakpoint(breakpoint, &lineNumber, &columnNumber); |
+ if (!m_continueToLocationBreakpointId.isEmpty()) { |
+ continueProgram(targetContextGroupId); |
+ return Response::OK(); |
+ } else { |
+ return Response::Error("No breakpoint by passed location"); |
dgozman
2017/05/16 18:51:04
Cannot continue to specified location
kozy
2017/05/16 19:01:16
Done.
|
+ } |
+} |
+ |
+void V8Debugger::clearContinueToLocation() { |
+ if (m_continueToLocationBreakpointId.length()) { |
+ removeBreakpoint(m_continueToLocationBreakpointId); |
+ } |
+ m_continueToLocationBreakpointId = String16(); |
dgozman
2017/05/16 18:51:04
Move this under if?
kozy
2017/05/16 19:01:16
Done.
|
+} |
+ |
Response V8Debugger::setScriptSource( |
const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun, |
Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails, |
@@ -567,6 +597,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext, |
hitBreakpointNumber->Int32Value(debuggerContext()).FromJust())); |
} |
} |
+ clearContinueToLocation(); |
m_pausedContext = pausedContext; |
m_executionState = executionState; |