summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/binary-reader-objdump.c16
-rw-r--r--test/dump/memory.txt2
-rw-r--r--test/dump/table.txt2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/binary-reader-objdump.c b/src/binary-reader-objdump.c
index fe149d95..7665f25f 100644
--- a/src/binary-reader-objdump.c
+++ b/src/binary-reader-objdump.c
@@ -459,7 +459,12 @@ static WasmResult on_import_global(uint32_t index,
static WasmResult on_memory(uint32_t index,
const WasmLimits* page_limits,
void* user_data) {
- print_details(user_data, " - memory %d\n", index);
+ print_details(user_data, " - memory[%d] pages: initial=%" PRId64,
+ index,
+ page_limits->initial);
+ if (page_limits->has_max)
+ print_details(user_data, " max=%" PRId64, page_limits->max);
+ print_details(user_data, "\n");
return WASM_OK;
}
@@ -467,12 +472,13 @@ static WasmResult on_table(uint32_t index,
WasmType elem_type,
const WasmLimits* elem_limits,
void* user_data) {
- print_details(user_data,
- " - [%d] type=%s init=%" PRId64 " max=%" PRId64 "\n",
+ print_details(user_data, " - table[%d] type=%s initial=%" PRId64,
index,
wasm_get_type_name(elem_type),
- elem_limits->initial,
- elem_limits->has_max ? elem_limits->max : 0);
+ elem_limits->initial);
+ if (elem_limits->has_max)
+ print_details(user_data, " max=%" PRId64, elem_limits->max);
+ print_details(user_data, "\n");
return WASM_OK;
}
diff --git a/test/dump/memory.txt b/test/dump/memory.txt
index 37f71349..2cf2336d 100644
--- a/test/dump/memory.txt
+++ b/test/dump/memory.txt
@@ -42,7 +42,7 @@ memory.wasm: file format wasm 0x00000d
Section Details:
MEMORY:
- - memory 0
+ - memory[0] pages: initial=1
DATA:
- memory[0] - init i32=10
- 0000000: 6865 6c6c 6f hello
diff --git a/test/dump/table.txt b/test/dump/table.txt
index c4459a20..4ece46b9 100644
--- a/test/dump/table.txt
+++ b/test/dump/table.txt
@@ -98,7 +98,7 @@ FUNCTION:
- func[1] sig=1
- func[2] sig=2
TABLE:
- - [0] type=anyfunc init=4 max=4
+ - table[0] type=anyfunc initial=4 max=4
ELEM:
- segment[0] table=0
- init i32=0