Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: src/inspector/v8-debugger.cc

Issue 2879923003: [inspector] added targetCallFrames for continueToLocation (Closed)
Patch Set: added a test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index cf7dc2a2e0671d845fc33d89f7c8be1d9c6bdd85..d4951f026df6c4a642cd56806276a4b34bec7067 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -414,7 +414,8 @@ void V8Debugger::scheduleStepIntoAsync(
Response V8Debugger::continueToLocation(
int targetContextGroupId,
- std::unique_ptr<protocol::Debugger::Location> location) {
+ std::unique_ptr<protocol::Debugger::Location> location,
+ const String16& strategy) {
DCHECK(isPaused());
DCHECK(!m_executionState.IsEmpty());
DCHECK(targetContextGroupId);
@@ -427,6 +428,15 @@ Response V8Debugger::continueToLocation(
m_continueToLocationBreakpointId =
setBreakpoint(breakpoint, &lineNumber, &columnNumber);
if (!m_continueToLocationBreakpointId.isEmpty()) {
+ m_continueToLocationStrategy = strategy;
+ if (m_continueToLocationStrategy !=
+ protocol::Debugger::ContinueToLocation::StrategyEnum::Default) {
+ m_continueToLocationStack = captureStackTrace(true);
+ if (!m_continueToLocationStack) {
dgozman 2017/05/16 20:19:24 DCHECK()
kozy 2017/05/16 21:18:48 Done.
+ m_continueToLocationStrategy =
+ protocol::Debugger::ContinueToLocation::StrategyEnum::Default;
+ }
+ }
continueProgram(targetContextGroupId);
return Response::OK();
} else {
@@ -434,11 +444,26 @@ Response V8Debugger::continueToLocation(
}
}
-void V8Debugger::clearContinueToLocation() {
- if (m_continueToLocationBreakpointId.length()) {
- removeBreakpoint(m_continueToLocationBreakpointId);
+bool V8Debugger::shouldIgnoreContinueToLocation() {
dgozman 2017/05/16 20:19:25 shouldContinueToCurrentLocation
kozy 2017/05/16 21:18:48 Done.
+ if (m_continueToLocationStrategy ==
+ protocol::Debugger::ContinueToLocation::StrategyEnum::Default) {
+ return false;
+ }
+ std::unique_ptr<V8StackTraceImpl> currentStack = captureStackTrace(true);
+ if (m_continueToLocationStrategy ==
+ protocol::Debugger::ContinueToLocation::StrategyEnum::InCurrentFrame) {
+ return !m_continueToLocationStack->isEqualIgnoringTopFrame(
+ currentStack.get());
}
+ return false;
+}
+
+void V8Debugger::clearContinueToLocation() {
+ if (m_continueToLocationBreakpointId.isEmpty()) return;
+ removeBreakpoint(m_continueToLocationBreakpointId);
m_continueToLocationBreakpointId = String16();
+ m_continueToLocationStrategy = String16();
+ m_continueToLocationStack.reset();
}
Response V8Debugger::setScriptSource(
@@ -596,6 +621,11 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
breakpointIds.push_back(String16::fromInteger(
hitBreakpointNumber->Int32Value(debuggerContext()).FromJust()));
}
+ if (breakpointIds.size() == 1 &&
+ breakpointIds[0] == m_continueToLocationBreakpointId) {
+ v8::Context::Scope contextScope(pausedContext);
+ if (shouldIgnoreContinueToLocation()) return;
+ }
}
clearContinueToLocation();

Powered by Google App Engine
This is Rietveld 408576698