Commit 9face690 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[inspector] Use consistent names for Wasm functions.

This changes the names reported in stack traces via the Chrome DevTools
protocol to follow the WAT naming convention for functions. This aligns
the behavior here with the rest of DevTools (i.e. the disassembly in the
Sources panel and the Scope sidebar, as well as the Console REPL) to use
one consistent naming scheme.

Fixed: chromium:1159307
Doc: http://bit.ly/devtools-wasm-entities
Bug: chromium:1162229, chromium:1164241, chromium:1071432
Change-Id: Ibe543f39c775944072073fe5f0959412529aa19b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2878734Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74456}
parent b4989f29
......@@ -12,6 +12,7 @@
#include "src/debug/debug.h"
#include "src/execution/vm-state-inl.h"
#include "src/objects/js-generator-inl.h"
#include "src/objects/stack-frame-info-inl.h"
#include "src/regexp/regexp-stack.h"
#if V8_ENABLE_WEBASSEMBLY
......@@ -43,6 +44,20 @@ v8_inspector::V8Inspector* GetInspector(Isolate* isolate) {
return reinterpret_cast<i::Isolate*>(isolate)->inspector();
}
Local<String> GetFunctionDebugName(Local<StackFrame> frame) {
#if V8_ENABLE_WEBASSEMBLY
auto info = Utils::OpenHandle(*frame);
if (info->IsWasm()) {
auto isolate = info->GetIsolate();
auto instance = handle(info->GetWasmInstance(), isolate);
auto func_index = info->GetWasmFunctionIndex();
return Utils::ToLocal(
i::GetWasmFunctionDebugName(isolate, instance, func_index));
}
#endif // V8_ENABLE_WEBASSEMBLY
return frame->GetFunctionName();
}
void SetBreakOnNextFunctionCall(Isolate* isolate) {
reinterpret_cast<i::Isolate*>(isolate)->debug()->SetBreakOnNextFunctionCall();
}
......
......@@ -38,6 +38,13 @@ int GetContextId(Local<Context> context);
void SetInspector(Isolate* isolate, v8_inspector::V8Inspector*);
v8_inspector::V8Inspector* GetInspector(Isolate* isolate);
// Returns the debug name for the function, which is supposed to be used
// by the debugger and the developer tools. This can thus be different from
// the name returned by the StackFrame::GetFunctionName() method. For example,
// in case of WebAssembly, the debug name is WAT-compatible and thus always
// preceeded by a dollar ('$').
Local<String> GetFunctionDebugName(Local<StackFrame> frame);
// Schedule a debugger break to happen when function is called inside given
// isolate.
V8_EXPORT_PRIVATE void SetBreakOnNextFunctionCall(Isolate* isolate);
......
......@@ -323,15 +323,7 @@ struct FunctionsProxy : NamedDebugProxy<FunctionsProxy, kFunctionsProxy> {
static Handle<String> GetName(Isolate* isolate,
Handle<WasmInstanceObject> instance,
uint32_t index) {
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
MaybeHandle<String> name =
WasmModuleObject::GetFunctionNameOrNull(isolate, module_object, index);
if (name.is_null()) {
name = GetNameFromImportsAndExportsOrNull(
isolate, instance, wasm::ImportExportKindCode::kExternalFunction,
index);
}
return GetNameOrDefault(isolate, name, "$func", index);
return GetWasmFunctionDebugName(isolate, instance, index);
}
};
......@@ -1050,6 +1042,24 @@ std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame) {
return std::make_unique<DebugWasmScopeIterator>(frame);
}
Handle<String> GetWasmFunctionDebugName(Isolate* isolate,
Handle<WasmInstanceObject> instance,
uint32_t func_index) {
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
MaybeHandle<String> maybe_name = WasmModuleObject::GetFunctionNameOrNull(
isolate, module_object, func_index);
if (module_object->is_asm_js()) {
// In case of asm.js, we use the names from the function declarations.
return maybe_name.ToHandleChecked();
}
if (maybe_name.is_null()) {
maybe_name = GetNameFromImportsAndExportsOrNull(
isolate, instance, wasm::ImportExportKindCode::kExternalFunction,
func_index);
}
return GetNameOrDefault(isolate, maybe_name, "$func", func_index);
}
Handle<ArrayList> AddWasmInstanceObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmInstanceObject> instance) {
......
......@@ -69,6 +69,10 @@ Handle<JSObject> GetWasmDebugProxy(WasmFrame* frame);
std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame);
Handle<String> GetWasmFunctionDebugName(Isolate* isolate,
Handle<WasmInstanceObject> instance,
uint32_t func_index);
Handle<ArrayList> AddWasmInstanceObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmInstanceObject> instance);
......
......@@ -27,6 +27,7 @@
#include "src/zone/zone-containers.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/debug/debug-wasm-objects.h"
#include "src/wasm/wasm-code-manager.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-objects-inl.h"
......@@ -1488,10 +1489,7 @@ Handle<Script> FrameSummary::WasmFrameSummary::script() const {
}
Handle<String> FrameSummary::WasmFrameSummary::FunctionName() const {
Handle<WasmModuleObject> module_object(wasm_instance()->module_object(),
isolate());
return WasmModuleObject::GetFunctionName(isolate(), module_object,
function_index());
return GetWasmFunctionDebugName(isolate(), wasm_instance(), function_index());
}
Handle<Context> FrameSummary::WasmFrameSummary::native_context() const {
......
......@@ -7,6 +7,7 @@
#include <algorithm>
#include "../../third_party/inspector_protocol/crdtp/json.h"
#include "src/debug/debug-interface.h"
#include "src/inspector/v8-debugger.h"
#include "src/inspector/v8-inspector-impl.h"
#include "src/tracing/trace-event.h"
......@@ -175,7 +176,8 @@ std::unique_ptr<StringBuffer> V8StackTraceId::ToString() {
}
StackFrame::StackFrame(v8::Isolate* isolate, v8::Local<v8::StackFrame> v8Frame)
: m_functionName(toProtocolString(isolate, v8Frame->GetFunctionName())),
: m_functionName(
toProtocolString(isolate, v8::debug::GetFunctionDebugName(v8Frame))),
m_scriptId(v8Frame->GetScriptId()),
m_sourceURL(
toProtocolString(isolate, v8Frame->GetScriptNameOrSourceURL())),
......
......@@ -232,20 +232,6 @@ MaybeHandle<String> WasmModuleObject::GetFunctionNameOrNull(
kNoInternalize);
}
Handle<String> WasmModuleObject::GetFunctionName(
Isolate* isolate, Handle<WasmModuleObject> module_object,
uint32_t func_index) {
MaybeHandle<String> name =
GetFunctionNameOrNull(isolate, module_object, func_index);
if (!name.is_null()) return name.ToHandleChecked();
EmbeddedVector<char, 32> buffer;
DCHECK_GE(func_index, module_object->module()->num_imported_functions);
int length = SNPrintF(buffer, "func%u", func_index);
return isolate->factory()
->NewStringFromOneByte(Vector<uint8_t>::cast(buffer.SubVector(0, length)))
.ToHandleChecked();
}
Vector<const uint8_t> WasmModuleObject::GetRawFunctionName(int func_index) {
if (func_index == wasm::kAnonymousFuncIndex) {
return Vector<const uint8_t>({nullptr, 0});
......
......@@ -166,12 +166,6 @@ class WasmModuleObject : public JSObject {
Handle<WasmModuleObject>,
uint32_t func_index);
// Get the function name of the function identified by the given index.
// Returns "func[func_index]" if the function is unnamed or the
// name is not a valid UTF-8 string.
static Handle<String> GetFunctionName(Isolate*, Handle<WasmModuleObject>,
uint32_t func_index);
// Get the raw bytes of the function name of the function identified by the
// given index.
// Meant to be used for debugging or frame printing.
......
......@@ -34,10 +34,10 @@ const a_add_offset = body_a.indexOf(kExprI32Add);
const b_sub_offset = body_b.indexOf(kExprI32Sub);
const expected_breaks = [
`a:1:${fun_a.body_offset + a_add_offset}`, // break in a at i32.add
`b:1:${fun_b.body_offset + b_sub_offset}`, // break in b at i32.sub
`a:1:${fun_a.body_offset + a_localget_offset}`, // break in a at local.get i0
`a:1:${fun_a.body_offset + a_const_offset}` // break in a at i32.const 1
`$a:1:${fun_a.body_offset + a_add_offset}`, // break in a at i32.add
`$b:1:${fun_b.body_offset + b_sub_offset}`, // break in b at i32.sub
`$a:1:${fun_a.body_offset + a_localget_offset}`, // break in a at local.get i0
`$a:1:${fun_a.body_offset + a_const_offset}` // break in a at i32.const 1
];
let error;
function onBreak(event, exec_state, data) {
......@@ -53,13 +53,13 @@ function onBreak(event, exec_state, data) {
assertEquals(expected_pos, pos);
// When we stop in b, we add another breakpoint in a at offset 0 and remove
// the existing breakpoint.
if (data.functionName() == 'b') {
if (data.functionName() === '$b') {
Debug.setBreakPoint(instance.exports.a, 0, a_localget_offset);
Debug.clearBreakPoint(breakpoint_a);
}
// When we stop at a at local.get, we set another breakpoint *in the same
// function*, one instruction later (at i32.const).
if (data.functionName() == 'a' &&
if (data.functionName() === '$a' &&
data.sourceColumn() == fun_a.body_offset) {
Debug.setBreakPoint(instance.exports.a, 0, a_const_offset);
}
......
......@@ -36,7 +36,7 @@ function listener(event, exec_state, event_data, data) {
event_data.sourceLineText().indexOf(`Line ${js_break_line}.`) > 0);
js_break_line++;
} else {
assertTrue(event_data.functionName() == 'sub');
assertTrue(event_data.functionName() == '$sub');
wasm_break_count++;
}
exec_state.prepareStep(Debug.StepAction.StepIn);
......
......@@ -14,8 +14,8 @@ var break_count = 0;
const expected_frames = [
// func-name; wasm?; pos; line; col
['call_debugger', false], // --
['wasm_2', true, 56, 1, 60], // --
['wasm_1', true, 52, 1, 55], // --
['$wasm_2', true, 56, 1, 60], // --
['$wasm_1', true, 52, 1, 55], // --
['testFrameInspection', false], // --
['', false]
];
......
......@@ -36,13 +36,13 @@ const expected_breaks = [
`imported:${import_line_nr + 1}:2`, // debugger;
`imported:${import_line_nr + 2}:2`, // return 7;
`imported:${import_line_nr + 2}:11`, // return 7;
'main:1:68', // i32.const 3
'main:1:70', // call 'sub'
'sub:1:58', // local.get i0
'sub:1:60', // local.get i1
'sub:1:62', // i32.sub
'sub:1:63', // end
'main:1:72' // end
'$main:1:68', // i32.const 3
'$main:1:70', // call 'sub'
'$sub:1:58', // local.get i0
'$sub:1:60', // local.get i1
'$sub:1:62', // i32.sub
'$sub:1:63', // end
'$main:1:72' // end
];
let error;
function onBreak(event, exec_state, data) {
......
......@@ -5,7 +5,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> instance = Instance
> module = Module
......@@ -14,7 +14,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> globals = Globals
> typeof globals = "object"
> Object.keys(globals) = Array(2)
......@@ -27,7 +27,7 @@ Debugger paused in main.
> globals["$global3"] = i64 {2n}
> $global3 = i64 {2n}
Stepping twice in main.
Debugger paused in main.
Debugger paused in $main.
> globals[0] = i32 {0}
> globals[1] = i32 {1}
> globals[2] = i64 {2n}
......@@ -51,7 +51,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> functions = Functions
> typeof functions = "object"
> Object.keys(functions) = Array(4)
......@@ -73,7 +73,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> locals = Locals
> typeof locals = "object"
> Object.keys(locals) = Array(2)
......@@ -85,7 +85,7 @@ Debugger paused in main.
> locals["$var2"] = i32 {0}
> $var2 = i32 {0}
Stepping twice in main.
Debugger paused in main.
Debugger paused in $main.
> locals[0] = i32 {3}
> locals[1] = i32 {6}
> locals[2] = i32 {42}
......@@ -99,7 +99,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> memories = Memories
> typeof memories = "object"
> Object.keys(memories) = Array(1)
......@@ -112,7 +112,7 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> tables = Tables
> typeof tables = "object"
> Object.keys(tables) = Array(1)
......@@ -125,12 +125,12 @@ Compile module.
Set breakpoint in main.
Instantiate module.
Call main.
Debugger paused in main.
Debugger paused in $main.
> stack = Stack
> typeof stack = "object"
> Object.keys(stack) = Array(0)
Stepping twice in main.
Debugger paused in main.
Debugger paused in $main.
> stack = Stack
> Object.keys(stack) = Array(2)
> stack[0] = i32 {5}
......
......@@ -8,7 +8,7 @@ Calling main()
Paused:
Script wasm://wasm/22e4830a byte offset 107: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func0 (0:107):
at $main (0:107):
- scope (wasm-expression-stack):
0: Array ((ref $ArrC))
object details:
......
......@@ -6,7 +6,7 @@ GC triggered
Debugger.resume
Hello World (v8://test/instantiate:11:36)
at bar (v8://test/instantiate:11:36)
at wasm_A (wasm://wasm/38e28046:1:54)
at $wasm_A (wasm://wasm/38e28046:1:54)
at test (test.js:4:20)
at (anonymous function) (:1:1)
exports.main returned!
......@@ -13,7 +13,7 @@ Setting breakpoint on line 2 (first instruction) of third function
Paused:
Script wasm://wasm/e33badc2 byte offset 169: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at C (interpreted) (0:169):
at $C (interpreted) (0:169):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -27,7 +27,7 @@ at C (interpreted) (0:169):
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at B (liftoff) (0:158):
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -44,7 +44,7 @@ at B (liftoff) (0:158):
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -63,7 +63,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 171: Wasm opcode 0x24 (kExprGlobalSet)
Scope:
at C (interpreted) (0:171):
at $C (interpreted) (0:171):
- scope (wasm-expression-stack):
stack: "0": 42 (i32)
- scope (local):
......@@ -77,7 +77,7 @@ at C (interpreted) (0:171):
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at B (liftoff) (0:158):
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -94,7 +94,7 @@ at B (liftoff) (0:158):
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -113,7 +113,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 173: Wasm opcode 0x41 (kExprI32Const)
Scope:
at C (interpreted) (0:173):
at $C (interpreted) (0:173):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -127,7 +127,7 @@ at C (interpreted) (0:173):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at B (liftoff) (0:158):
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -144,7 +144,7 @@ at B (liftoff) (0:158):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -163,7 +163,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 175: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at C (interpreted) (0:175):
at $C (interpreted) (0:175):
- scope (wasm-expression-stack):
stack: "0": 47 (i32)
- scope (local):
......@@ -177,7 +177,7 @@ at C (interpreted) (0:175):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at B (liftoff) (0:158):
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -194,7 +194,7 @@ at B (liftoff) (0:158):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -213,7 +213,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 177: Wasm opcode 0x0b (kExprEnd)
Scope:
at C (interpreted) (0:177):
at $C (interpreted) (0:177):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -227,7 +227,7 @@ at C (interpreted) (0:177):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at B (liftoff) (0:158):
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -244,7 +244,7 @@ at B (liftoff) (0:158):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -263,7 +263,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 160: Wasm opcode 0x1a (kExprDrop)
Scope:
at B (liftoff) (0:160):
at $B (liftoff) (0:160):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
- scope (local):
......@@ -280,7 +280,7 @@ at B (liftoff) (0:160):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -299,7 +299,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 161: Wasm opcode 0x1a (kExprDrop)
Scope:
at B (liftoff) (0:161):
at $B (liftoff) (0:161):
- scope (wasm-expression-stack):
stack: "0": 42 (i32)
- scope (local):
......@@ -316,7 +316,7 @@ at B (liftoff) (0:161):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -335,7 +335,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 162: Wasm opcode 0x0b (kExprEnd)
Scope:
at B (liftoff) (0:162):
at $B (liftoff) (0:162):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -352,7 +352,7 @@ at B (liftoff) (0:162):
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables: "$exported_table": (Table)
at A (liftoff) (0:128):
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -371,7 +371,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/e33badc2 byte offset 130: Wasm opcode 0x0b (kExprEnd)
Scope:
at A (liftoff) (0:130):
at $A (liftoff) (0:130):
- scope (wasm-expression-stack):
stack:
- scope (local):
......
......@@ -8,7 +8,7 @@ Calling main(4)
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -16,7 +16,7 @@ at wasm_A (0:38):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -39,7 +39,7 @@ Setting breakpoint at offset 47 on script v8://test/runWasm
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -47,7 +47,7 @@ at wasm_A (0:39):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -61,7 +61,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
at $wasm_B (0:45):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -75,7 +75,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
at $wasm_B (0:47):
- scope (wasm-expression-stack):
stack: "0": 3 (i32)
- scope (local):
......@@ -89,7 +89,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
at $wasm_B (0:49):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -103,7 +103,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
at $wasm_B (0:51):
- scope (wasm-expression-stack):
stack: "0": 3 (i32)
- scope (local):
......@@ -117,7 +117,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
at $wasm_B (0:53):
- scope (wasm-expression-stack):
stack: "0": 3 (i32), "1": 1 (i32)
- scope (local):
......@@ -131,7 +131,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
stack: "0": 2 (i32)
- scope (local):
......@@ -145,7 +145,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -153,7 +153,7 @@ at wasm_A (0:38):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -167,7 +167,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -175,7 +175,7 @@ at wasm_A (0:39):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -189,7 +189,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
at $wasm_B (0:45):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -203,7 +203,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
at $wasm_B (0:47):
- scope (wasm-expression-stack):
stack: "0": 2 (i32)
- scope (local):
......@@ -217,7 +217,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
at $wasm_B (0:49):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -231,7 +231,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
at $wasm_B (0:51):
- scope (wasm-expression-stack):
stack: "0": 2 (i32)
- scope (local):
......@@ -245,7 +245,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
at $wasm_B (0:53):
- scope (wasm-expression-stack):
stack: "0": 2 (i32), "1": 1 (i32)
- scope (local):
......@@ -259,7 +259,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
stack: "0": 1 (i32)
- scope (local):
......@@ -273,7 +273,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -281,7 +281,7 @@ at wasm_A (0:38):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -295,7 +295,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -303,7 +303,7 @@ at wasm_A (0:39):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -317,7 +317,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
at $wasm_B (0:45):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -331,7 +331,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
at $wasm_B (0:47):
- scope (wasm-expression-stack):
stack: "0": 1 (i32)
- scope (local):
......@@ -345,7 +345,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
at $wasm_B (0:49):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -359,7 +359,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
at $wasm_B (0:51):
- scope (wasm-expression-stack):
stack: "0": 1 (i32)
- scope (local):
......@@ -373,7 +373,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
at $wasm_B (0:53):
- scope (wasm-expression-stack):
stack: "0": 1 (i32), "1": 1 (i32)
- scope (local):
......@@ -387,7 +387,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
stack: "0": 0 (i32)
- scope (local):
......@@ -401,7 +401,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -409,7 +409,7 @@ at wasm_A (0:38):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -423,7 +423,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -431,7 +431,7 @@ at wasm_A (0:39):
instance: exports: "main" (Function)
module: Module
functions: "$wasm_A": (Function), "$wasm_B": (Function)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -445,7 +445,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
at $wasm_B (0:45):
- scope (wasm-expression-stack):
stack:
- scope (local):
......@@ -459,7 +459,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
at $wasm_B (0:47):
- scope (wasm-expression-stack):
stack: "0": 0 (i32)
- scope (local):
......@@ -473,7 +473,7 @@ at (anonymous) (0:17):
Paused:
Script wasm://wasm/0c10a5fe byte offset 61: Wasm opcode 0x0b (kExprEnd)
Scope:
at wasm_B (0:61):
at $wasm_B (0:61):
- scope (wasm-expression-stack):
stack:
- scope (local):
......
......@@ -3,8 +3,8 @@ Running testFunction with generated wasm bytes...
Paused on 'debugger;'
Number of frames: 5
- [0] {"functionName":"call_debugger","function_lineNumber":1,"function_columnNumber":24,"lineNumber":2,"columnNumber":4}
- [1] {"functionName":"call_func","lineNumber":0,"columnNumber":55}
- [2] {"functionName":"main","lineNumber":0,"columnNumber":62}
- [1] {"functionName":"$call_func","lineNumber":0,"columnNumber":55}
- [2] {"functionName":"$main","lineNumber":0,"columnNumber":62}
- [3] {"functionName":"testFunction","function_lineNumber":0,"function_columnNumber":21,"lineNumber":14,"columnNumber":19}
- [4] {"functionName":"","function_lineNumber":0,"function_columnNumber":0,"lineNumber":0,"columnNumber":0}
Getting v8-generated stack trace...
......
......@@ -6,7 +6,7 @@ Calling div function.
Paused at:
--- 0 ---
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
scope at div (0:46):
scope at $div (0:46):
$a: 1 (i32)
$b: 0 (i32)
$unused: 4711 (i32)
......@@ -36,7 +36,7 @@ Paused at:
Paused at:
--- 0 ---
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
scope at div (0:46):
scope at $div (0:46):
$a: -2147483648 (i32)
$b: -1 (i32)
$unused: 4711 (i32)
......
......@@ -12,7 +12,7 @@ Setting breakpoint on offset 54 (on the setlocal before the call), url wasm://wa
scriptId : <scriptId>
}
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
0: 3 (i32)
- scope (local):
......@@ -24,7 +24,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 3 (i32)
......@@ -35,12 +35,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 3 (i32)
......@@ -51,12 +51,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 3 (i32)
......@@ -67,7 +67,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
at $wasm_B (0:58):
- scope (wasm-expression-stack):
- scope (local):
$var0: 3 (i32)
......@@ -78,7 +78,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
0: 2 (i32)
- scope (local):
......@@ -90,7 +90,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 2 (i32)
......@@ -101,7 +101,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
at $wasm_B (0:58):
- scope (wasm-expression-stack):
- scope (local):
$var0: 2 (i32)
......@@ -112,7 +112,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.resume called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
0: 1 (i32)
- scope (local):
......@@ -124,7 +124,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 1 (i32)
......@@ -135,12 +135,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 1 (i32)
......@@ -151,7 +151,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
at $wasm_B (0:58):
- scope (wasm-expression-stack):
- scope (local):
$var0: 1 (i32)
......@@ -162,7 +162,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
at wasm_B (0:45):
at $wasm_B (0:45):
- scope (wasm-expression-stack):
- scope (local):
$var0: 1 (i32)
......@@ -173,7 +173,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 47: Wasm opcode 0x04 (kExprIf)
at wasm_B (0:47):
at $wasm_B (0:47):
- scope (wasm-expression-stack):
0: 1 (i32)
- scope (local):
......@@ -185,7 +185,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
at wasm_B (0:49):
at $wasm_B (0:49):
- scope (wasm-expression-stack):
- scope (local):
$var0: 1 (i32)
......@@ -196,7 +196,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 51: Wasm opcode 0x41 (kExprI32Const)
at wasm_B (0:51):
at $wasm_B (0:51):
- scope (wasm-expression-stack):
0: 1 (i32)
- scope (local):
......@@ -208,7 +208,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
at wasm_B (0:53):
at $wasm_B (0:53):
- scope (wasm-expression-stack):
0: 1 (i32)
1: 1 (i32)
......@@ -221,7 +221,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
at $wasm_B (0:54):
- scope (wasm-expression-stack):
0: 0 (i32)
- scope (local):
......@@ -233,7 +233,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 0 (i32)
......@@ -244,12 +244,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
at $wasm_A (0:38):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 0 (i32)
......@@ -260,12 +260,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:39):
at $wasm_A (0:39):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 0 (i32)
......@@ -276,12 +276,12 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 40: Wasm opcode 0x0b (kExprEnd)
at wasm_A (0:40):
at $wasm_A (0:40):
- scope (wasm-expression-stack):
- scope (local):
- scope (module):
-- skipped
at wasm_B (0:56):
at $wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
$var0: 0 (i32)
......@@ -292,7 +292,7 @@ at (anonymous) (0:17):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
at $wasm_B (0:58):
- scope (wasm-expression-stack):
- scope (local):
$var0: 0 (i32)
......
......@@ -5,7 +5,7 @@ Running testFunction with generated wasm bytes...
Paused on 'debugger;'
Number of frames: 5
- [0] call_debugger
- [1] func1
- [2] func2
- [1] $func1
- [2] $main
- [3] testFunction
- [4]
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