summaryrefslogtreecommitdiff
path: root/src/binary-reader-objdump.c
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2016-12-13 11:00:47 -0800
committerGitHub <noreply@github.com>2016-12-13 11:00:47 -0800
commit55293660eb9f01d50256cb272478e2ad86713c6b (patch)
treef8605db8b7fd7548cb1c77baaea16657c17cb1da /src/binary-reader-objdump.c
parent3d97c2f760623427b3cacb2240b44e87f57b345f (diff)
downloadwabt-55293660eb9f01d50256cb272478e2ad86713c6b.tar.gz
wabt-55293660eb9f01d50256cb272478e2ad86713c6b.tar.bz2
wabt-55293660eb9f01d50256cb272478e2ad86713c6b.zip
wasmdump: improve printing of limits (#244)
Diffstat (limited to 'src/binary-reader-objdump.c')
-rw-r--r--src/binary-reader-objdump.c16
1 files changed, 11 insertions, 5 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;
}