Commit ad42f966 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[wasm][debug] Expose instance and module instead of imports / exports.

The "imports" and "exports" that were exposed on WebAssembly frames via
Debug-Evaluate aren't useful for the DWARF C/C++ extension (and likely
not for any other language extension), since they only expose static
information that's easily available (upfront) by reading the Wasm wire
bytes.

In fact, there are already standardized functions in the WebAssembly
specification, namely `WebAssembly.Module.imports(module)` and
`WebAssembly.Module.exports(module)`, which yield static information
about the imports and exports of a Wasm module.

So instead of exposing special, non-standard "imports" and "exports", we
now instead expose both the "instance" and the "module" objects via both
the Debug Proxy and the Scope view, and also add internal [[Exports]]
and [[Imports]] properties to WasmModuleObject, which under the hood use
the standard methods mentioned above.

Fixed: chromium:1162069
Bug: chromium:1071432, chromium:1083146
Screenshot: https://imgur.com/lcaW2jL.png
Doc: https://docs.google.com/document/d/1rqbu0jKTl3q_xCxLnKzkjGXWEsHnJ9aERVhKV9RNDgE#bookmark=id.925bb2qgou38
Change-Id: Ie27e55bb08ea5f90493c57375bf2b48dfb11a4d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2606050
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71893}
parent 2cab7ae9
......@@ -347,6 +347,20 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
}
}
return factory->NewJSArrayWithElements(result, PACKED_ELEMENTS, index);
} else if (object->IsWasmModuleObject()) {
auto module_object = Handle<WasmModuleObject>::cast(object);
Handle<FixedArray> result = factory->NewFixedArray(2 * 2);
Handle<String> exports_str =
factory->NewStringFromStaticChars("[[Exports]]");
Handle<JSArray> exports_obj = wasm::GetExports(isolate, module_object);
result->set(0, *exports_str);
result->set(1, *exports_obj);
Handle<String> imports_str =
factory->NewStringFromStaticChars("[[Imports]]");
Handle<JSArray> imports_obj = wasm::GetImports(isolate, module_object);
result->set(2, *imports_str);
result->set(3, *imports_obj);
return factory->NewJSArrayWithElements(result, PACKED_ELEMENTS);
}
return factory->NewJSArray(0);
}
......
......@@ -201,6 +201,12 @@ Handle<JSObject> GetModuleScopeObject(Handle<WasmInstanceObject> instance) {
JSObject::AddProperty(isolate, module_scope_object, instance_name, instance,
NONE);
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
Handle<String> module_name =
isolate->factory()->InternalizeString(StaticCharVector("module"));
JSObject::AddProperty(isolate, module_scope_object, module_name,
module_object, NONE);
if (instance->has_memory_object()) {
Handle<String> name;
// TODO(duongn): extend the logic when multiple memories are supported.
......
......@@ -2496,27 +2496,6 @@ Handle<JSMap> GetFunctionNames(Handle<WasmInstanceObject> instance) {
return names;
}
// Generate names for the imports.
Handle<JSMap> GetImportNames(Handle<WasmInstanceObject> instance) {
Isolate* isolate = instance->GetIsolate();
const wasm::WasmModule* module = instance->module();
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
size_t num_imports = module->import_table.size();
Handle<JSMap> names = isolate->factory()->NewJSMap();
for (size_t index = 0; index < num_imports; ++index) {
HandleScope scope(isolate);
const wasm::WasmImport& import = module->import_table[index];
SetMapValue(isolate, names,
WasmModuleObject::ExtractUtf8StringFromModuleBytes(
isolate, module_object, import.field_name, kInternalize),
isolate->factory()->NewNumberFromSize(index));
}
return names;
}
// Generate names for the memories.
Handle<JSMap> GetMemoryNames(Handle<WasmInstanceObject> instance) {
Isolate* isolate = instance->GetIsolate();
......@@ -2556,24 +2535,6 @@ Handle<JSMap> GetTableNames(Handle<WasmInstanceObject> instance) {
return names;
}
// Generate names for the exports
Handle<JSMap> GetExportNames(Handle<WasmInstanceObject> instance) {
Isolate* isolate = instance->GetIsolate();
const wasm::WasmModule* module = instance->module();
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
size_t num_exports = module->export_table.size();
Handle<JSMap> names = isolate->factory()->NewJSMap();
for (size_t index = 0; index < num_exports; ++index) {
const wasm::WasmExport& exp = module->export_table[index];
SetMapValue(isolate, names,
WasmModuleObject::ExtractUtf8StringFromModuleBytes(
isolate, module_object, exp.name, kInternalize),
isolate->factory()->NewNumberFromSize(index));
}
return names;
}
Address GetPC(Isolate* isolate, Handle<JSObject> handler) {
Handle<Object> pc =
JSObject::GetProperty(isolate, handler, "pc").ToHandleChecked();
......@@ -2778,86 +2739,6 @@ Handle<Object> GetTableImpl(Isolate* isolate, Handle<Name> property,
return func_table;
}
base::Optional<int> HasImportImpl(Isolate* isolate, Handle<Name> property,
Handle<JSObject> handler,
bool enable_index_lookup) {
Handle<WasmInstanceObject> instance = GetInstance(isolate, handler);
base::Optional<int> index =
ResolveValueSelector(isolate, property, handler, enable_index_lookup,
"imports", GetImportNames);
if (!index) return index;
const wasm::WasmModule* module = instance->module();
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
int num_imports = static_cast<int>(module->import_table.size());
if (0 <= *index && *index < num_imports) return index;
return {};
}
Handle<JSObject> GetExternalObject(Isolate* isolate,
wasm::ImportExportKindCode kind,
uint32_t index) {
Handle<JSObject> result = isolate->factory()->NewJSObjectWithNullProto();
Handle<Object> value = isolate->factory()->NewNumberFromUint(index);
switch (kind) {
case wasm::kExternalFunction:
JSObject::AddProperty(isolate, result, "func", value, NONE);
break;
case wasm::kExternalGlobal:
JSObject::AddProperty(isolate, result, "global", value, NONE);
break;
case wasm::kExternalTable:
JSObject::AddProperty(isolate, result, "table", value, NONE);
break;
case wasm::kExternalMemory:
JSObject::AddProperty(isolate, result, "mem", value, NONE);
break;
case wasm::kExternalException:
JSObject::AddProperty(isolate, result, "exn", value, NONE);
break;
}
return result;
}
Handle<Object> GetImportImpl(Isolate* isolate, Handle<Name> property,
Handle<JSObject> handler,
bool enable_index_lookup) {
Handle<WasmInstanceObject> instance = GetInstance(isolate, handler);
base::Optional<int> index =
HasImportImpl(isolate, property, handler, enable_index_lookup);
if (!index) return isolate->factory()->undefined_value();
const wasm::WasmImport& imp = instance->module()->import_table[*index];
return GetExternalObject(isolate, imp.kind, imp.index);
}
base::Optional<int> HasExportImpl(Isolate* isolate, Handle<Name> property,
Handle<JSObject> handler,
bool enable_index_lookup) {
Handle<WasmInstanceObject> instance = GetInstance(isolate, handler);
base::Optional<int> index =
ResolveValueSelector(isolate, property, handler, enable_index_lookup,
"exports", GetExportNames);
if (!index) return index;
const wasm::WasmModule* module = instance->module();
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
int num_exports = static_cast<int>(module->export_table.size());
if (0 <= *index && *index < num_exports) return index;
return {};
}
Handle<Object> GetExportImpl(Isolate* isolate, Handle<Name> property,
Handle<JSObject> handler,
bool enable_index_lookup) {
Handle<WasmInstanceObject> instance = GetInstance(isolate, handler);
base::Optional<int> index =
HasExportImpl(isolate, property, handler, enable_index_lookup);
if (!index) return isolate->factory()->undefined_value();
const wasm::WasmExport& exp = instance->module()->export_table[*index];
return GetExternalObject(isolate, exp.kind, exp.index);
}
// Generic has trap callback for the index space proxies.
template <base::Optional<int> Impl(Isolate*, Handle<Name>, Handle<JSObject>,
bool)>
......@@ -3052,22 +2933,19 @@ Handle<JSObject> GetStackObject(WasmFrame* frame) {
// type WasmSimdValue = Uint8Array;
// type WasmValue = number | bigint | object | WasmSimdValue;
// type WasmFunction = (... args : WasmValue[]) = > WasmValue;
// type WasmExport = {name : string} & ({func : number} | {table : number} |
// {mem : number} | {global : number});
// type WasmImport = {name : string, module : string} &
// ({func : number} | {table : number} | {mem : number} |
// {global : number});
// interface WasmInterface {
// $globalX: WasmValue;
// $varX: WasmValue;
// $funcX(a : WasmValue /*, ...*/) : WasmValue;
// readonly $memoryX : WebAssembly.Memory;
// readonly $tableX : WebAssembly.Table;
//
// readonly instance : WebAssembly.Instance;
// readonly module : WebAssembly.Module;
//
// readonly memories : {[nameOrIndex:string | number] : WebAssembly.Memory};
// readonly tables : {[nameOrIndex:string | number] : WebAssembly.Table};
// readonly stack : WasmValue[];
// readonly imports : {[nameOrIndex:string | number] : WasmImport};
// readonly exports : {[nameOrIndex:string | number] : WasmExport};
// readonly globals : {[nameOrIndex:string | number] : WasmValue};
// readonly locals : {[nameOrIndex:string | number] : WasmValue};
// readonly functions : {[nameOrIndex:string | number] : WasmFunction};
......@@ -3077,12 +2955,12 @@ Handle<JSObject> GetStackObject(WasmFrame* frame) {
// functions are JSProxies that lazily produce values either by index or by
// name. A top level JSProxy is wrapped around those for top-level lookup of
// names in the disambiguation order  memory, local, table, function, global.
// Import and export names are not globally resolved.
Handle<JSProxy> WasmJs::GetJSDebugProxy(WasmFrame* frame) {
Isolate* isolate = frame->isolate();
Factory* factory = isolate->factory();
Handle<WasmInstanceObject> instance(frame->wasm_instance(), isolate);
Handle<WasmModuleObject> module_object(instance->module_object(), isolate);
// The top level proxy delegates lookups to the index space proxies.
Handle<JSObject> handler = factory->NewJSObjectWithNullProto();
......@@ -3093,6 +2971,10 @@ Handle<JSProxy> WasmJs::GetJSDebugProxy(WasmFrame* frame) {
Handle<JSObject> target = factory->NewJSObjectWithNullProto();
// Expose "instance" and "module" on the target.
JSObject::AddProperty(isolate, target, "instance", instance, READ_ONLY);
JSObject::AddProperty(isolate, target, "module", module_object, READ_ONLY);
// Generate JSMaps per index space for name->index lookup. Every index space
// proxy is associated with its table for local name lookup.
......@@ -3119,14 +3001,6 @@ Handle<JSProxy> WasmJs::GetJSDebugProxy(WasmFrame* frame) {
HasTrapCallback<HasTableImpl>);
JSObject::AddProperty(isolate, target, "tables", tables, READ_ONLY);
auto imports = GetJSProxy(frame, {}, GetTrapCallback<GetImportImpl>,
HasTrapCallback<HasImportImpl>);
JSObject::AddProperty(isolate, target, "imports", imports, READ_ONLY);
auto exports = GetJSProxy(frame, {}, GetTrapCallback<GetExportImpl>,
HasTrapCallback<HasExportImpl>);
JSObject::AddProperty(isolate, target, "exports", exports, READ_ONLY);
auto stack = GetStackObject(frame);
JSObject::AddProperty(isolate, target, "stack", stack, READ_ONLY);
......
......@@ -62,7 +62,7 @@ async function logMemoryName(msg, Protocol) {
})).result.result;
for (let prop of moduleObjectProps) {
if (prop.name == 'instance') continue;
if (prop.name === 'instance' || prop.name === 'module') continue;
InspectorTest.log(`name: ${prop.name}`);
}
}
......
......@@ -19,6 +19,7 @@ at C (interpreted) (0:169):
var2: 0 (f32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at B (liftoff) (0:158):
......@@ -34,6 +35,7 @@ at B (liftoff) (0:158):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at A (liftoff) (0:128):
......@@ -42,6 +44,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at (anonymous) (0:17):
......@@ -60,6 +63,7 @@ at C (interpreted) (0:171):
var2: 0 (f32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at B (liftoff) (0:158):
......@@ -75,6 +79,7 @@ at B (liftoff) (0:158):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at A (liftoff) (0:128):
......@@ -83,6 +88,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 0 (i32)
at (anonymous) (0:17):
......@@ -100,6 +106,7 @@ at C (interpreted) (0:173):
var2: 0 (f32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at B (liftoff) (0:158):
......@@ -115,6 +122,7 @@ at B (liftoff) (0:158):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -123,6 +131,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -141,6 +150,7 @@ at C (interpreted) (0:175):
var2: 0 (f32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at B (liftoff) (0:158):
......@@ -156,6 +166,7 @@ at B (liftoff) (0:158):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -164,6 +175,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -181,6 +193,7 @@ at C (interpreted) (0:177):
var2: 0 (f32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at B (liftoff) (0:158):
......@@ -196,6 +209,7 @@ at B (liftoff) (0:158):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -204,6 +218,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -226,6 +241,7 @@ at B (liftoff) (0:160):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -234,6 +250,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -255,6 +272,7 @@ at B (liftoff) (0:161):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -263,6 +281,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -283,6 +302,7 @@ at B (liftoff) (0:162):
v128_local: 17 00 00 00 17 00 00 00 17 00 00 00 17 00 00 00 (v128)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at A (liftoff) (0:128):
......@@ -291,6 +311,7 @@ at A (liftoff) (0:128):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......@@ -306,6 +327,7 @@ at A (liftoff) (0:130):
var0: 42 (i32)
- scope (module):
instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function)
module: Module
exported_memory: Memory(1)
globals: "exported_global": 42 (i32)
at (anonymous) (0:17):
......
......@@ -11,12 +11,14 @@ at wasm_A (0:38):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Setting breakpoint at offset 39 on script v8://test/runWasm
......@@ -36,12 +38,14 @@ at wasm_A (0:39):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -53,6 +57,7 @@ at wasm_B (0:45):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -65,6 +70,7 @@ at wasm_B (0:47):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -76,6 +82,7 @@ at wasm_B (0:49):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -88,6 +95,7 @@ at wasm_B (0:51):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -101,6 +109,7 @@ at wasm_B (0:53):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -113,6 +122,7 @@ at wasm_B (0:54):
var0: 3 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -123,12 +133,14 @@ at wasm_A (0:38):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -139,12 +151,14 @@ at wasm_A (0:39):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -156,6 +170,7 @@ at wasm_B (0:45):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -168,6 +183,7 @@ at wasm_B (0:47):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -179,6 +195,7 @@ at wasm_B (0:49):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -191,6 +208,7 @@ at wasm_B (0:51):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -204,6 +222,7 @@ at wasm_B (0:53):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -216,6 +235,7 @@ at wasm_B (0:54):
var0: 2 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -226,12 +246,14 @@ at wasm_A (0:38):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -242,12 +264,14 @@ at wasm_A (0:39):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -259,6 +283,7 @@ at wasm_B (0:45):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -271,6 +296,7 @@ at wasm_B (0:47):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -282,6 +308,7 @@ at wasm_B (0:49):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -294,6 +321,7 @@ at wasm_B (0:51):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -307,6 +335,7 @@ at wasm_B (0:53):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -319,6 +348,7 @@ at wasm_B (0:54):
var0: 1 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -329,12 +359,14 @@ at wasm_A (0:38):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 0 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -345,12 +377,14 @@ at wasm_A (0:39):
- scope (local):
- scope (module):
instance: exports: "main" (Function)
module: Module
at wasm_B (0:56):
- scope (wasm-expression-stack):
- scope (local):
var0: 0 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -362,6 +396,7 @@ at wasm_B (0:45):
var0: 0 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -374,6 +409,7 @@ at wasm_B (0:47):
var0: 0 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
Paused:
......@@ -385,6 +421,7 @@ at wasm_B (0:61):
var0: 0 (i32)
- scope (module):
instance: exports: "main" (Function)
module: Module
at (anonymous) (0:17):
-- skipped
exports.main returned!
......
......@@ -51,7 +51,8 @@ function printIfFailure(message) {
async function getScopeValues(name, value) {
if (value.type == 'object') {
if (value.subtype === 'typedarray' || value.subtype == 'webassemblymemory') return value.description;
if (name == 'instance') return dumpInstanceProperties(value);
if (name === 'instance') return dumpInstanceProperties(value);
if (name === 'module') return value.description;
let msg = await Protocol.Runtime.getProperties({objectId: value.objectId});
printIfFailure(msg);
......
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