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. |