Commit e34425a2 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][debug] Remove debugging capabilities from WasmDebugInfo

This CL removes all debugging capabilities from the API provided by
WasmDebugInfo:
- setting and removing breakpoints
- stepping
- stack inspection

The WasmDebugInfo is still kept, since it's used from tests to
instantiate the interpreter.

R=thibaudm@chromium.org, bmeurer@chromium.org

Bug: v8:10389
Change-Id: I297bfc8df2104dae8b9f9f9b13078026c47698da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2164791Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67418}
parent 138ac70f
......@@ -129,11 +129,9 @@ bool DebugScopeIterator::SetVariableValue(v8::Local<v8::String> name,
}
DebugWasmScopeIterator::DebugWasmScopeIterator(Isolate* isolate,
StandardFrame* frame,
int inlined_frame_index)
StandardFrame* frame)
: isolate_(isolate),
frame_(frame),
inlined_frame_index_(inlined_frame_index),
type_(debug::ScopeIterator::ScopeTypeModule) {}
bool DebugWasmScopeIterator::Done() {
......@@ -172,13 +170,6 @@ v8::Local<v8::Object> DebugWasmScopeIterator::GetObject() {
return Utils::ToLocal(wasm::GetModuleScopeObject(instance));
}
case debug::ScopeIterator::ScopeTypeLocal: {
if (frame_->is_wasm_interpreter_entry()) {
Handle<WasmDebugInfo> debug_info(
WasmInterpreterEntryFrame::cast(frame_)->debug_info(), isolate_);
return Utils::ToLocal(WasmDebugInfo::GetLocalScopeObject(
debug_info, frame_->fp(), inlined_frame_index_));
}
// Compiled code.
DCHECK(frame_->is_wasm_compiled());
wasm::DebugInfo* debug_info =
WasmCompiledFrame::cast(frame_)->native_module()->GetDebugInfo();
......@@ -186,13 +177,6 @@ v8::Local<v8::Object> DebugWasmScopeIterator::GetObject() {
isolate_, frame_->pc(), frame_->fp(), frame_->callee_fp()));
}
case debug::ScopeIterator::ScopeTypeWasmExpressionStack: {
if (frame_->is_wasm_interpreter_entry()) {
Handle<WasmDebugInfo> debug_info(
WasmInterpreterEntryFrame::cast(frame_)->debug_info(), isolate_);
return Utils::ToLocal(WasmDebugInfo::GetStackScopeObject(
debug_info, frame_->fp(), inlined_frame_index_));
}
// Compiled code.
DCHECK(frame_->is_wasm_compiled());
wasm::DebugInfo* debug_info =
WasmCompiledFrame::cast(frame_)->native_module()->GetDebugInfo();
......
......@@ -39,8 +39,7 @@ class DebugScopeIterator final : public debug::ScopeIterator {
class DebugWasmScopeIterator final : public debug::ScopeIterator {
public:
DebugWasmScopeIterator(Isolate* isolate, StandardFrame* frame,
int inlined_frame_index);
DebugWasmScopeIterator(Isolate* isolate, StandardFrame* frame);
bool Done() override;
void Advance() override;
......@@ -57,7 +56,6 @@ class DebugWasmScopeIterator final : public debug::ScopeIterator {
private:
Isolate* isolate_;
StandardFrame* frame_;
int inlined_frame_index_;
ScopeType type_;
};
} // namespace internal
......
......@@ -160,8 +160,8 @@ DebugStackTraceIterator::GetScopeIterator() const {
DCHECK(!Done());
StandardFrame* frame = iterator_.frame();
if (frame->is_wasm()) {
return std::make_unique<DebugWasmScopeIterator>(isolate_, iterator_.frame(),
inlined_frame_index_);
return std::make_unique<DebugWasmScopeIterator>(isolate_,
iterator_.frame());
}
return std::make_unique<DebugScopeIterator>(isolate_, frame_inspector_.get());
}
......
......@@ -1026,14 +1026,6 @@ void Debug::PrepareStep(StepAction step_action) {
thread_local_.last_frame_count_ = current_frame_count;
// No longer perform the current async step.
clear_suspended_generator();
} else if (frame->is_wasm_interpreter_entry()) {
// Handle stepping in wasm functions via the wasm interpreter.
WasmInterpreterEntryFrame* wasm_frame =
WasmInterpreterEntryFrame::cast(frame);
if (wasm_frame->NumberOfActiveFrames() > 0) {
wasm_frame->debug_info().PrepareStep(step_action);
return;
}
} else if (frame->is_wasm_compiled()) {
// Handle stepping in Liftoff code.
WasmCompiledFrame* wasm_frame = WasmCompiledFrame::cast(frame);
......
......@@ -533,13 +533,6 @@ MaybeHandle<WasmInstanceObject> InstanceBuilder::Build() {
if (thrower_->error()) return {};
}
//--------------------------------------------------------------------------
// Debugging support.
//--------------------------------------------------------------------------
// Set all breakpoints that were set on the shared module.
WasmScript::SetBreakpointsOnNewInstance(
handle(module_object_->script(), isolate_), instance);
//--------------------------------------------------------------------------
// Create a wrapper for the start function.
//--------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -843,28 +843,11 @@ class WasmDebugInfo : public Struct {
V8_EXPORT_PRIVATE static wasm::WasmInterpreter* SetupForTesting(
Handle<WasmInstanceObject>);
// Prepare WasmDebugInfo for stepping in the given function.
V8_EXPORT_PRIVATE static void PrepareStepIn(Handle<WasmDebugInfo>,
int func_index);
// Set a breakpoint in the given function at the given byte offset within that
// function. This will redirect all future calls to this function to the
// interpreter and will always pause at the given offset.
V8_EXPORT_PRIVATE static void SetBreakpoint(Handle<WasmDebugInfo>,
int func_index, int offset);
// Clear a previously set breakpoint in the given function at the given byte
// offset within that function.
V8_EXPORT_PRIVATE static void ClearBreakpoint(Handle<WasmDebugInfo>,
int func_index, int offset);
// Make a set of functions always execute in the interpreter without setting
// breakpoints.
V8_EXPORT_PRIVATE static void RedirectToInterpreter(Handle<WasmDebugInfo>,
Vector<int> func_indexes);
void PrepareStep(StepAction);
// Execute the specified function in the interpreter. Read arguments from the
// {argument_values} vector and write to {return_values} on regular exit.
// The frame_pointer will be used to identify the new activation of the
......@@ -890,18 +873,6 @@ class WasmDebugInfo : public Struct {
// Returns the number of calls / function frames executed in the interpreter.
V8_EXPORT_PRIVATE uint64_t NumInterpretedCalls();
// Get local scope details for a specific interpreted frame. It contains
// information about parameters, locals, and stack values.
static Handle<JSObject> GetLocalScopeObject(Handle<WasmDebugInfo>,
Address frame_pointer,
int frame_index);
// Get stack scope details for a specific interpreted frame. It contains
// information about stack values.
static Handle<JSObject> GetStackScopeObject(Handle<WasmDebugInfo>,
Address frame_pointer,
int frame_index);
V8_EXPORT_PRIVATE static Handle<Code> GetCWasmEntry(Handle<WasmDebugInfo>,
const wasm::FunctionSig*);
......@@ -942,9 +913,6 @@ class WasmScript : public AllStatic {
V8_EXPORT_PRIVATE static bool ClearBreakPointById(Handle<Script>,
int breakpoint_id);
static void SetBreakpointsOnNewInstance(Handle<Script>,
Handle<WasmInstanceObject>);
// Get a list of all possible breakpoints within a given range of this module.
V8_EXPORT_PRIVATE static bool GetPossibleBreakpoints(
wasm::NativeModule* native_module, const debug::Location& start,
......
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