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

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

Issue 2748503002: [inspector] changed a way of preserving stepping between tasks (Closed)
Patch Set: rebased on tunned stepping at return Created 3 years, 9 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
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 1749efcf25d287949f1731d062c39e1b5de92c7e..f4c3ca5813a05249ba56d1278fde1a9561ddee80 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -328,8 +328,14 @@ void V8Debugger::setPauseOnExceptionsState(
m_pauseOnExceptionsState = pauseOnExceptionsState;
}
-void V8Debugger::setPauseOnNextStatement(bool pause) {
+void V8Debugger::setPauseOnNextStatement(bool pause, int targetContextGroupId) {
if (isPaused()) return;
+ DCHECK(targetContextGroupId);
+ if (!pause && m_targetContextGroupId &&
+ m_targetContextGroupId != targetContextGroupId) {
+ return;
+ }
+ m_targetContextGroupId = targetContextGroupId;
if (pause)
v8::debug::DebugBreak(m_isolate);
else
@@ -354,23 +360,29 @@ void V8Debugger::continueProgram() {
m_executionState.Clear();
}
-void V8Debugger::stepIntoStatement() {
+void V8Debugger::stepIntoStatement(int targetContextGroupId) {
DCHECK(isPaused());
DCHECK(!m_executionState.IsEmpty());
+ DCHECK(targetContextGroupId);
+ m_targetContextGroupId = targetContextGroupId;
v8::debug::PrepareStep(m_isolate, v8::debug::StepIn);
continueProgram();
}
-void V8Debugger::stepOverStatement() {
+void V8Debugger::stepOverStatement(int targetContextGroupId) {
DCHECK(isPaused());
DCHECK(!m_executionState.IsEmpty());
+ DCHECK(targetContextGroupId);
+ m_targetContextGroupId = targetContextGroupId;
v8::debug::PrepareStep(m_isolate, v8::debug::StepNext);
continueProgram();
}
-void V8Debugger::stepOutOfFunction() {
+void V8Debugger::stepOutOfFunction(int targetContextGroupId) {
DCHECK(isPaused());
DCHECK(!m_executionState.IsEmpty());
+ DCHECK(targetContextGroupId);
+ m_targetContextGroupId = targetContextGroupId;
v8::debug::PrepareStep(m_isolate, v8::debug::StepOut);
continueProgram();
}
@@ -504,6 +516,12 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
// Don't allow nested breaks.
if (isPaused()) return;
+ int contextGroupId = m_inspector->contextGroupId(pausedContext);
+ if (m_targetContextGroupId && contextGroupId != m_targetContextGroupId) {
+ v8::debug::PrepareStep(m_isolate, v8::debug::StepOut);
+ return;
+ }
+ m_targetContextGroupId = 0;
V8DebuggerAgentImpl* agent = m_inspector->enabledDebuggerAgentForGroup(
m_inspector->contextGroupId(pausedContext));
if (!agent || (agent->skipAllPauses() && !m_scheduledOOMBreak)) return;
@@ -549,7 +567,10 @@ void V8Debugger::v8OOMCallback(void* data) {
V8Debugger* thisPtr = static_cast<V8Debugger*>(data);
thisPtr->m_isolate->IncreaseHeapLimitForDebugging();
thisPtr->m_scheduledOOMBreak = true;
- thisPtr->setPauseOnNextStatement(true);
+ v8::Local<v8::Context> context = thisPtr->m_isolate->GetEnteredContext();
+ DCHECK(!context.IsEmpty());
+ thisPtr->setPauseOnNextStatement(
+ true, thisPtr->m_inspector->contextGroupId(context));
}
void V8Debugger::ScriptCompiled(v8::Local<v8::debug::Script> script,
@@ -660,6 +681,7 @@ void V8Debugger::handleAsyncTaskStepping(v8::Local<v8::Context> context,
if (createdByUser && type == v8::debug::kDebugPromiseCreated) {
if (agent->shouldBreakInScheduledAsyncTask()) {
m_taskWithScheduledBreak = task;
+ v8::debug::ClearStepping(m_isolate);
}
return;
}
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698