Commit 50d5fb7a authored by Kim-Anh Tran's avatar Kim-Anh Tran Committed by V8 LUCI CQ

[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/+/3427208Reviewed-by: 's avatarJaroslav 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}
parent d1afc531
......@@ -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());
}
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment