[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/+/3310804
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78223}
This commit is contained in:
Kim-Anh Tran 2021-12-02 15:54:42 +01:00 committed by V8 LUCI CQ
parent 0a34cc58cc
commit 8df29f1e15
3 changed files with 9 additions and 3 deletions

View File

@ -126,7 +126,8 @@ enum class BreakReason : uint8_t {
kException,
kAssert,
kDebuggerStatement,
kOOM
kOOM,
kScheduled
};
typedef base::EnumSet<BreakReason> BreakReasons;

View File

@ -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(

View File

@ -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();
}