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

Side by Side Diff: src/inspector/v8-debugger.cc

Issue 2842903002: [inspector] improved V8Debugger::breakProgram method (Closed)
Patch Set: rebased 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 unified diff | Download patch
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/inspector/v8-debugger.h" 5 #include "src/inspector/v8-debugger.h"
6 6
7 #include "src/inspector/debugger-script.h" 7 #include "src/inspector/debugger-script.h"
8 #include "src/inspector/inspected-context.h" 8 #include "src/inspector/inspected-context.h"
9 #include "src/inspector/protocol/Protocol.h" 9 #include "src/inspector/protocol/Protocol.h"
10 #include "src/inspector/script-breakpoint.h" 10 #include "src/inspector/script-breakpoint.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 v8::debug::DebugBreak(m_isolate); 347 v8::debug::DebugBreak(m_isolate);
348 else 348 else
349 v8::debug::CancelDebugBreak(m_isolate); 349 v8::debug::CancelDebugBreak(m_isolate);
350 } 350 }
351 351
352 bool V8Debugger::canBreakProgram() { 352 bool V8Debugger::canBreakProgram() {
353 if (!m_breakpointsActivated) return false; 353 if (!m_breakpointsActivated) return false;
354 return !v8::debug::AllFramesOnStackAreBlackboxed(m_isolate); 354 return !v8::debug::AllFramesOnStackAreBlackboxed(m_isolate);
355 } 355 }
356 356
357 void V8Debugger::breakProgram() { 357 bool V8Debugger::breakProgram(int targetContextGroupId) {
358 // Don't allow nested breaks. 358 // Don't allow nested breaks.
359 if (isPaused()) return; 359 if (isPaused()) return true;
360 if (!canBreakProgram()) return; 360 if (!canBreakProgram()) return true;
361 DCHECK(targetContextGroupId);
362 m_targetContextGroupId = targetContextGroupId;
361 v8::debug::BreakRightNow(m_isolate); 363 v8::debug::BreakRightNow(m_isolate);
364 return m_inspector->enabledDebuggerAgentForGroup(targetContextGroupId);
362 } 365 }
363 366
364 void V8Debugger::continueProgram(int targetContextGroupId) { 367 void V8Debugger::continueProgram(int targetContextGroupId) {
365 if (m_pausedContextGroupId != targetContextGroupId) return; 368 if (m_pausedContextGroupId != targetContextGroupId) return;
366 if (isPaused()) m_inspector->client()->quitMessageLoopOnPause(); 369 if (isPaused()) m_inspector->client()->quitMessageLoopOnPause();
367 m_pausedContext.Clear(); 370 m_pausedContext.Clear();
368 m_executionState.Clear(); 371 m_executionState.Clear();
369 } 372 }
370 373
371 void V8Debugger::stepIntoStatement(int targetContextGroupId) { 374 void V8Debugger::stepIntoStatement(int targetContextGroupId) {
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 fprintf(stdout, "Async stacks count: %d\n", m_asyncStacksCount); 1080 fprintf(stdout, "Async stacks count: %d\n", m_asyncStacksCount);
1078 fprintf(stdout, "Scheduled async tasks: %zu\n", m_asyncTaskStacks.size()); 1081 fprintf(stdout, "Scheduled async tasks: %zu\n", m_asyncTaskStacks.size());
1079 fprintf(stdout, "Created async tasks: %zu\n", 1082 fprintf(stdout, "Created async tasks: %zu\n",
1080 m_asyncTaskCreationStacks.size()); 1083 m_asyncTaskCreationStacks.size());
1081 fprintf(stdout, "Async tasks with parent: %zu\n", m_parentTask.size()); 1084 fprintf(stdout, "Async tasks with parent: %zu\n", m_parentTask.size());
1082 fprintf(stdout, "Recurring async tasks: %zu\n", m_recurringTasks.size()); 1085 fprintf(stdout, "Recurring async tasks: %zu\n", m_recurringTasks.size());
1083 fprintf(stdout, "\n"); 1086 fprintf(stdout, "\n");
1084 } 1087 }
1085 1088
1086 } // namespace v8_inspector 1089 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698