Skip to content

Commit

Permalink
deps: V8: cherry-pick 50d5fb7a457c
Browse files Browse the repository at this point in the history
Original commit message:

    [debugger] Pass break reason for interrupt along with BreakRightNow

    This explicitly passes along the break reason when requesting a pause
    that is handled via an interrupt. Pushing the break reason is not
    enough (as done before), as the reason may be used and consumed on
    another pause call that triggers a setPauseOnNextCall.

    Fixed: chromium:1292519
    Change-Id: If8635c9397a7b9a1e6757be8048c9edc613c27f8
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427208
    Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
    Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
    Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78885}

Refs: v8/v8@50d5fb7

PR-URL: nodejs#41610
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Mar 7, 2022
1 parent c233737 commit 2d17a95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/v8/src/inspector/v8-debugger-agent-impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,10 @@ Response V8DebuggerAgentImpl::pause() {
if (!enabled()) return Response::ServerError(kDebuggerNotEnabled);
if (isPaused()) return Response::Success();

pushBreakDetails(protocol::Debugger::Paused::ReasonEnum::Other, nullptr);
if (m_debugger->canBreakProgram()) {
m_debugger->interruptAndBreak(m_session->contextGroupId());
} else {
pushBreakDetails(protocol::Debugger::Paused::ReasonEnum::Other, nullptr);
m_debugger->setPauseOnNextCall(true, m_session->contextGroupId());
}

Expand Down
6 changes: 5 additions & 1 deletion deps/v8/src/inspector/v8-debugger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ void V8Debugger::interruptAndBreak(int targetContextGroupId) {
DCHECK(targetContextGroupId);
m_targetContextGroupId = targetContextGroupId;
m_isolate->RequestInterrupt(
[](v8::Isolate* isolate, void*) { v8::debug::BreakRightNow(isolate); },
[](v8::Isolate* isolate, void*) {
v8::debug::BreakRightNow(
isolate,
v8::debug::BreakReasons({v8::debug::BreakReason::kScheduled}));
},
nullptr);
}

Expand Down

0 comments on commit 2d17a95

Please sign in to comment.