From f74184ea038106f31b678357621e805a4943b75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 1 Feb 2022 14:14:55 +0100 Subject: [PATCH] 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 Commit-Queue: Kim-Anh Tran Auto-Submit: Kim-Anh Tran Cr-Commit-Position: refs/heads/main@{#78885} Refs: https://github.com/v8/v8/commit/50d5fb7a457cf49ec4d8f8ed9e500c07b5465356 PR-URL: https://github.com/nodejs/node/pull/41610 Reviewed-By: Jiawen Geng Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen Reviewed-By: Colin Ihrig --- common.gypi | 2 +- deps/v8/src/inspector/v8-debugger-agent-impl.cc | 2 +- deps/v8/src/inspector/v8-debugger.cc | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 0a2e9e6dc18046..82332df3619ba6 100644 --- a/common.gypi +++ b/common.gypi @@ -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.10', + 'v8_embedder_string': '-node.11', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/inspector/v8-debugger-agent-impl.cc b/deps/v8/src/inspector/v8-debugger-agent-impl.cc index 21c7f5f3c46cde..4f209360f9c449 100644 --- a/deps/v8/src/inspector/v8-debugger-agent-impl.cc +++ b/deps/v8/src/inspector/v8-debugger-agent-impl.cc @@ -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()); } diff --git a/deps/v8/src/inspector/v8-debugger.cc b/deps/v8/src/inspector/v8-debugger.cc index d1c6a45b08a06a..79307da36cad78 100644 --- a/deps/v8/src/inspector/v8-debugger.cc +++ b/deps/v8/src/inspector/v8-debugger.cc @@ -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); }