| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 3ad31c95034f5fae843bac552aed83fe5544887d..96d1780174bfd50edfa34c3fc48b88e14ecc08aa 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -9008,8 +9008,9 @@ bool DebugInterface::Script::GetPossibleBreakpoints(
|
| CHECK(!start.IsEmpty());
|
| i::Handle<i::Script> script = Utils::OpenHandle(this);
|
| if (script->type() == i::Script::TYPE_WASM) {
|
| - // TODO(clemensh): Return the proper thing once we support wasm breakpoints.
|
| - return false;
|
| + i::Handle<i::WasmCompiledModule> compiled_module(
|
| + i::WasmCompiledModule::cast(script->wasm_compiled_module()));
|
| + return compiled_module->GetPossibleBreakpoints(start, end, locations);
|
| }
|
|
|
| i::Script::InitLineEnds(script);
|
| @@ -9127,6 +9128,23 @@ int DebugInterface::WasmScript::NumImportedFunctions() const {
|
| return static_cast<int>(compiled_module->module()->num_imported_functions);
|
| }
|
|
|
| +std::pair<int, int> DebugInterface::WasmScript::GetFunctionRange(
|
| + int function_index) const {
|
| + i::DisallowHeapAllocation no_gc;
|
| + i::Handle<i::Script> script = Utils::OpenHandle(this);
|
| + DCHECK_EQ(i::Script::TYPE_WASM, script->type());
|
| + i::WasmCompiledModule* compiled_module =
|
| + i::WasmCompiledModule::cast(script->wasm_compiled_module());
|
| + DCHECK_LE(0, function_index);
|
| + DCHECK_GT(compiled_module->module()->functions.size(), function_index);
|
| + i::wasm::WasmFunction& func =
|
| + compiled_module->module()->functions[function_index];
|
| + DCHECK_GE(i::kMaxInt, func.code_start_offset);
|
| + DCHECK_GE(i::kMaxInt, func.code_end_offset);
|
| + return std::make_pair(static_cast<int>(func.code_start_offset),
|
| + static_cast<int>(func.code_end_offset));
|
| +}
|
| +
|
| std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>>
|
| DebugInterface::WasmScript::DisassembleFunction(int function_index) {
|
| i::DisallowHeapAllocation no_gc;
|
|
|