diff --git a/src/debug/debug.cc b/src/debug/debug.cc index 31949bb553..39d09784ce 100644 --- a/src/debug/debug.cc +++ b/src/debug/debug.cc @@ -2194,10 +2194,16 @@ void Debug::HandleDebugBreak() { DCHECK(!it.done()); Object* fun = it.frame()->function(); if (fun && fun->IsJSFunction()) { - // Don't stop in builtin functions. - if (!JSFunction::cast(fun)->shared()->IsSubjectToDebugging()) return; - if (isolate_->stack_guard()->CheckDebugBreak() && + // Don't stop in builtin and blackboxed functions. + if (!JSFunction::cast(fun)->shared()->IsSubjectToDebugging() || IsBlackboxed(JSFunction::cast(fun)->shared())) { + // Inspector uses pause on next statement for asynchronous breakpoints. + // When breakpoint is fired we try to break on first not blackboxed + // statement. To achieve this goal we need to deoptimize current + // function and don't clear requested DebugBreak even if it's blackboxed + // to be able to break on not blackboxed function call. + // TODO(yangguo): introduce break_on_function_entry since current + // implementation is slow. Deoptimizer::DeoptimizeFunction(JSFunction::cast(fun)); return; } diff --git a/test/inspector/debugger/framework-break-expected.txt b/test/inspector/debugger/framework-break-expected.txt index 3832d81201..437c1f8e59 100644 --- a/test/inspector/debugger/framework-break-expected.txt +++ b/test/inspector/debugger/framework-break-expected.txt @@ -27,13 +27,7 @@ breakpoint (framework.js:24:2) Running test: testDebuggerStatement > all frames in framework: -debuggerStatement (framework.js:28:2) -(anonymous) (framework.js:0:0) - > mixed, top frame in framework: -debuggerStatement (framework.js:28:2) -(anonymous) (user.js:0:0) - Running test: testSyncDOMBreakpoint > all frames in framework: diff --git a/test/inspector/debugger/framework-stepping.js b/test/inspector/debugger/framework-stepping.js index 831a4491ef..de75eab9ab 100644 --- a/test/inspector/debugger/framework-stepping.js +++ b/test/inspector/debugger/framework-stepping.js @@ -11,7 +11,7 @@ function frameworkCall(funcs) { } function frameworkBreakAndCall(funcs) { - debugger; + breakProgram('', ''); for (var f of funcs) f(); } //# sourceURL=framework.js`,