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 <[email protected]>
    Commit-Queue: Kim-Anh Tran <[email protected]>
    Auto-Submit: Kim-Anh Tran <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#78885}

Refs: v8/v8@50d5fb7

PR-URL: #41610
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
targos committed Feb 2, 2022
1 parent 48708be commit 468fffd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.11',
'v8_embedder_string': '-node.12',

##### V8 defaults for Node.js #####

Expand Down
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 @@ -215,7 +215,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 468fffd

Please sign in to comment.