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

Unified Diff: src/debug/debug.cc

Issue 2668763003: [inspector] V8DebuggerAgent cleanup (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | src/inspector/v8-debugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index adf3659c68fdf560f267037772bf9baa38efd747..045dd8616010b6c0ed5b4e0bf2fe0d6f4f722a55 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1027,6 +1027,15 @@ void Debug::PrepareStep(StepAction step_action) {
Handle<DebugInfo> debug_info(shared->GetDebugInfo());
BreakLocation location = BreakLocation::FromFrame(debug_info, js_frame);
+ // It is used at least in two cases:
+ // - step-next at return position from first callback in microtask will break
+ // in next callback,
+ // - step-next at return position when caller frame is blackboxed will break
+ // in next not blackboxed function called by caller frame if any.
+ if (step_action == StepNext && location.IsReturn()) {
kozy 2017/02/01 07:29:43 Yang, WDYT about this part? This code is just move
Yang 2017/02/01 07:46:12 for the microtask case, we should make a check at
kozy 2017/02/02 06:58:56 I think that case with blackboxed code could be co
Yang 2017/02/02 12:10:49 You are right. Step-in at the return position to i
+ thread_local_.last_step_action_ = StepIn;
+ UpdateHookOnFunctionCall();
+ }
// Any step at a return is a step-out.
if (location.IsReturn()) step_action = StepOut;
// A step-next at a tail call is a step-out.
@@ -1820,6 +1829,13 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise) {
if (debug_delegate_) {
HandleScope scope(isolate_);
+ {
+ // Exception from JavaScript should always contains at least one frame.
+ JavaScriptFrameIterator it(isolate_);
+ DCHECK(!it.done());
+ if (it.done()) return;
kozy 2017/02/01 07:29:43 Yang, do you know when we can have empty stack her
Yang 2017/02/01 07:46:12 might be possible, e.g. if we call directly into a
kozy 2017/02/02 06:58:55 Done.
+ }
+
// Create the execution state.
Handle<Object> exec_state;
// Bail out and don't call debugger if exception.
« no previous file with comments | « no previous file | src/inspector/v8-debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698