#include "src/wasm/wasm-debug.h"
#include <iomanip>
#include <unordered_map>
#include "src/common/assert-scope.h"
#include "src/common/simd128.h"
#include "src/compiler/wasm-compiler.h"
#include "src/debug/debug-evaluate.h"
#include "src/debug/debug.h"
#include "src/execution/frames-inl.h"
#include "src/heap/factory.h"
#include "src/wasm/baseline/liftoff-compiler.h"
#include "src/wasm/baseline/liftoff-register.h"
#include "src/wasm/compilation-environment-inl.h"
#include "src/wasm/module-decoder.h"
#include "src/wasm/std-object-sizes.h"
#include "src/wasm/value-type.h"
#include "src/wasm/wasm-code-manager.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-limits.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-opcodes-inl.h"
#include "src/wasm/wasm-subtyping.h"
#include "src/wasm/wasm-value.h"
#include "src/zone/accounting-allocator.h"
namespace v8 {
namespace internal {
namespace wasm {
namespace {
ImportExportKey;
enum ReturnLocation { … };
Address FindNewPC(WasmFrame* frame, WasmCode* wasm_code, int byte_offset,
ReturnLocation return_location) { … }
}
void DebugSideTable::Print(std::ostream& os) const { … }
void DebugSideTable::Entry::Print(std::ostream& os) const { … }
size_t DebugSideTable::Entry::EstimateCurrentMemoryConsumption() const { … }
size_t DebugSideTable::EstimateCurrentMemoryConsumption() const { … }
class DebugInfoImpl { … };
DebugInfo::DebugInfo(NativeModule* native_module)
: … { … }
DebugInfo::~DebugInfo() = default;
int DebugInfo::GetNumLocals(Address pc, Isolate* isolate) { … }
WasmValue DebugInfo::GetLocalValue(int local, Address pc, Address fp,
Address debug_break_fp, Isolate* isolate) { … }
int DebugInfo::GetStackDepth(Address pc, Isolate* isolate) { … }
WasmValue DebugInfo::GetStackValue(int index, Address pc, Address fp,
Address debug_break_fp, Isolate* isolate) { … }
const wasm::WasmFunction& DebugInfo::GetFunctionAtAddress(Address pc,
Isolate* isolate) { … }
void DebugInfo::SetBreakpoint(int func_index, int offset,
Isolate* current_isolate) { … }
bool DebugInfo::PrepareStep(WasmFrame* frame) { … }
void DebugInfo::PrepareStepOutTo(WasmFrame* frame) { … }
void DebugInfo::ClearStepping(Isolate* isolate) { … }
void DebugInfo::ClearStepping(WasmFrame* frame) { … }
bool DebugInfo::IsStepping(WasmFrame* frame) { … }
void DebugInfo::RemoveBreakpoint(int func_index, int offset,
Isolate* current_isolate) { … }
void DebugInfo::RemoveDebugSideTables(base::Vector<WasmCode* const> code) { … }
DebugSideTable* DebugInfo::GetDebugSideTableIfExists(
const WasmCode* code) const { … }
void DebugInfo::RemoveIsolate(Isolate* isolate) { … }
size_t DebugInfo::EstimateCurrentMemoryConsumption() const { … }
}
namespace {
int FindNextBreakablePosition(wasm::NativeModule* native_module, int func_index,
int offset_in_func) { … }
void SetBreakOnEntryFlag(Tagged<Script> script, bool enabled) { … }
}
bool WasmScript::SetBreakPoint(DirectHandle<Script> script, int* position,
DirectHandle<BreakPoint> break_point) { … }
void WasmScript::SetInstrumentationBreakpoint(
DirectHandle<Script> script, DirectHandle<BreakPoint> break_point) { … }
bool WasmScript::SetBreakPointOnFirstBreakableForFunction(
DirectHandle<Script> script, int func_index,
DirectHandle<BreakPoint> break_point) { … }
bool WasmScript::SetBreakPointForFunction(
DirectHandle<Script> script, int func_index, int offset,
DirectHandle<BreakPoint> break_point) { … }
namespace {
int GetBreakpointPos(Isolate* isolate,
Tagged<Object> break_point_info_or_undef) { … }
int FindBreakpointInfoInsertPos(Isolate* isolate,
DirectHandle<FixedArray> breakpoint_infos,
int position) { … }
}
bool WasmScript::ClearBreakPoint(DirectHandle<Script> script, int position,
DirectHandle<BreakPoint> break_point) { … }
bool WasmScript::ClearBreakPointById(DirectHandle<Script> script,
int breakpoint_id) { … }
void WasmScript::ClearAllBreakpoints(Tagged<Script> script) { … }
void WasmScript::AddBreakpointToInfo(DirectHandle<Script> script, int position,
DirectHandle<BreakPoint> break_point) { … }
bool WasmScript::GetPossibleBreakpoints(
wasm::NativeModule* native_module, const v8::debug::Location& start,
const v8::debug::Location& end,
std::vector<v8::debug::BreakLocation>* locations) { … }
namespace {
bool CheckBreakPoint(Isolate* isolate, DirectHandle<BreakPoint> break_point,
StackFrameId frame_id) { … }
}
MaybeHandle<FixedArray> WasmScript::CheckBreakPoints(
Isolate* isolate, DirectHandle<Script> script, int position,
StackFrameId frame_id) { … }
}
}