Commit 24c4b776 authored by Paolo Severini's avatar Paolo Severini Committed by Commit Bot

[wasm] Fix ClearBreakPoint when debugging in Liftoff

This fixes an issue in WasmScript::ClearBreakPoint, which is was still removing
breakpoints in the interpreter, even when debugging in Liftoff.
The existing test inspector/debugger/wasm-stepping-liftoff.js does not require
any changes.

Change-Id: I5c60839ffde91cdd11d9f808a3102f2cc1324087
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136872Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#67065}
parent 3b224b0c
......@@ -1331,19 +1331,21 @@ bool WasmScript::ClearBreakPoint(Handle<Script> script, int position,
return false;
}
// Iterate over all instances and tell them to remove this breakpoint.
// We do this using the weak list of all instances from the script.
Handle<WeakArrayList> weak_instance_list(script->wasm_weak_instance_list(),
isolate);
for (int i = 0; i < weak_instance_list->length(); ++i) {
MaybeObject maybe_instance = weak_instance_list->Get(i);
if (maybe_instance->IsWeak()) {
Handle<WasmInstanceObject> instance(
WasmInstanceObject::cast(maybe_instance->GetHeapObjectAssumeWeak()),
isolate);
Handle<WasmDebugInfo> debug_info =
WasmInstanceObject::GetOrCreateDebugInfo(instance);
WasmDebugInfo::ClearBreakpoint(debug_info, func_index, offset_in_func);
if (!FLAG_debug_in_liftoff) {
// Iterate over all instances and tell them to remove this breakpoint.
// We do this using the weak list of all instances from the script.
Handle<WeakArrayList> weak_instance_list(script->wasm_weak_instance_list(),
isolate);
for (int i = 0; i < weak_instance_list->length(); ++i) {
MaybeObject maybe_instance = weak_instance_list->Get(i);
if (maybe_instance->IsWeak()) {
Handle<WasmInstanceObject> instance(
WasmInstanceObject::cast(maybe_instance->GetHeapObjectAssumeWeak()),
isolate);
Handle<WasmDebugInfo> debug_info =
WasmInstanceObject::GetOrCreateDebugInfo(instance);
WasmDebugInfo::ClearBreakpoint(debug_info, func_index, offset_in_func);
}
}
}
......
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