Commit 8df29f1e authored by Kim-Anh Tran's avatar Kim-Anh Tran Committed by V8 LUCI CQ

[debugger] Explicitly encode calls from %ScheduleBreak as 'other'

This CL forwards the information that we are breaking because
of a ScheduleBreak runtime call.

Bug: chromium:1229541, chromium:1133307
Change-Id: I5eb9462c9df135bc3b3080c354e61e301d24e1ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3310804Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78223}
parent 0a34cc58
......@@ -126,7 +126,8 @@ enum class BreakReason : uint8_t {
kException,
kAssert,
kDebuggerStatement,
kOOM
kOOM,
kScheduled
};
typedef base::EnumSet<BreakReason> BreakReasons;
......
......@@ -1827,7 +1827,8 @@ void V8DebuggerAgentImpl::didPause(
const bool otherBreakReasons =
hitRegularBreakpoint ||
breakReasons.contains(v8::debug::BreakReason::kStep) ||
breakReasons.contains(v8::debug::BreakReason::kDebuggerStatement);
breakReasons.contains(v8::debug::BreakReason::kDebuggerStatement) ||
breakReasons.contains(v8::debug::BreakReason::kScheduled);
if (otherBreakReasons && std::find(hitReasons.begin(), hitReasons.end(),
otherHitReason) == hitReasons.end()) {
hitReasons.push_back(
......
......@@ -148,7 +148,11 @@ RUNTIME_FUNCTION(Runtime_ScheduleBreak) {
SealHandleScope shs(isolate);
DCHECK_EQ(0, args.length());
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);
return ReadOnlyRoots(isolate).undefined_value();
}
......
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