Skip to content

Commit 2d17a95

Browse files
committed
deps: V8: cherry-pick 50d5fb7a457c
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>
1 parent c233737 commit 2d17a95

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

deps/v8/src/inspector/v8-debugger-agent-impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,10 +1141,10 @@ Response V8DebuggerAgentImpl::pause() {
11411141
if (!enabled()) return Response::ServerError(kDebuggerNotEnabled);
11421142
if (isPaused()) return Response::Success();
11431143

1144-
pushBreakDetails(protocol::Debugger::Paused::ReasonEnum::Other, nullptr);
11451144
if (m_debugger->canBreakProgram()) {
11461145
m_debugger->interruptAndBreak(m_session->contextGroupId());
11471146
} else {
1147+
pushBreakDetails(protocol::Debugger::Paused::ReasonEnum::Other, nullptr);
11481148
m_debugger->setPauseOnNextCall(true, m_session->contextGroupId());
11491149
}
11501150

deps/v8/src/inspector/v8-debugger.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ void V8Debugger::interruptAndBreak(int targetContextGroupId) {
217217
DCHECK(targetContextGroupId);
218218
m_targetContextGroupId = targetContextGroupId;
219219
m_isolate->RequestInterrupt(
220-
[](v8::Isolate* isolate, void*) { v8::debug::BreakRightNow(isolate); },
220+
[](v8::Isolate* isolate, void*) {
221+
v8::debug::BreakRightNow(
222+
isolate,
223+
v8::debug::BreakReasons({v8::debug::BreakReason::kScheduled}));
224+
},
221225
nullptr);
222226
}
223227

0 commit comments

Comments
 (0)