From 2d17a9573337f2aaacfd3af6b4e75b3fc605ed4b 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 --- deps/v8/src/inspector/v8-debugger-agent-impl.cc | 2 +- deps/v8/src/inspector/v8-debugger.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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); }