summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/binary-reader-objdump.cc13
-rw-r--r--test/dump/debug-import-names.txt2
-rw-r--r--test/dump/debug-names.txt4
-rw-r--r--test/link/names.txt10
-rw-r--r--test/link/names_import_only.txt2
-rw-r--r--test/link/names_import_only_module_env.txt2
6 files changed, 19 insertions, 14 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc
index 8b40c2ad..30e97d72 100644
--- a/src/binary-reader-objdump.cc
+++ b/src/binary-reader-objdump.cc
@@ -630,7 +630,10 @@ Result BinaryReaderObjdump::OnFunctionCount(Index count) {
}
Result BinaryReaderObjdump::OnFunction(Index index, Index sig_index) {
- PrintDetails(" - func[%" PRIindex "] sig=%" PRIindex "\n", index, sig_index);
+ PrintDetails(" - func[%" PRIindex "] sig=%" PRIindex, index, sig_index);
+ if (const char* name = GetFunctionName(index))
+ PrintDetails(" <%s>", name);
+ PrintDetails("\n");
return Result::Ok;
}
@@ -656,9 +659,11 @@ Result BinaryReaderObjdump::OnImportFunc(Index import_index,
StringSlice field_name,
Index func_index,
Index sig_index) {
- PrintDetails(" - func[%" PRIindex "] sig=%" PRIindex " <- " PRIstringslice
- "." PRIstringslice "\n",
- func_index, sig_index, WABT_PRINTF_STRING_SLICE_ARG(module_name),
+ PrintDetails(" - func[%" PRIindex "] sig=%" PRIindex, func_index, sig_index);
+ if (const char* name = GetFunctionName(func_index))
+ PrintDetails(" <%s>", name);
+ PrintDetails(" <- " PRIstringslice "." PRIstringslice "\n",
+ WABT_PRINTF_STRING_SLICE_ARG(module_name),
WABT_PRINTF_STRING_SLICE_ARG(field_name));
return Result::Ok;
}
diff --git a/test/dump/debug-import-names.txt b/test/dump/debug-import-names.txt
index 4a239b79..c76870c6 100644
--- a/test/dump/debug-import-names.txt
+++ b/test/dump/debug-import-names.txt
@@ -59,7 +59,7 @@ Section Details:
Type:
- [0] () -> nil
Import:
- - func[0] sig=0 <- bar.foo
+ - func[0] sig=0 <$foo> <- bar.foo
Custom:
- name: "name"
- func[0] $foo
diff --git a/test/dump/debug-names.txt b/test/dump/debug-names.txt
index a0583462..1fabf5cc 100644
--- a/test/dump/debug-names.txt
+++ b/test/dump/debug-names.txt
@@ -127,9 +127,9 @@ Type:
- [0] (i32) -> nil
- [1] (f32) -> nil
Function:
- - func[0] sig=0
+ - func[0] sig=0 <$F1>
- func[1] sig=1
- - func[2] sig=1
+ - func[2] sig=1 <$F2>
Custom:
- name: "name"
- func[0] $F1
diff --git a/test/link/names.txt b/test/link/names.txt
index 4db64be2..aa616aa1 100644
--- a/test/link/names.txt
+++ b/test/link/names.txt
@@ -42,14 +42,14 @@ Type:
- [2] (i64) -> nil
- [3] (i32) -> nil
Import:
- - func[0] sig=0 <- __extern.missing0
+ - func[0] sig=0 <$import_func0> <- __extern.missing0
- func[1] sig=0 <- _extern1.missing1
- - func[2] sig=0 <- extern2.missing2
+ - func[2] sig=0 <$import_func2> <- extern2.missing2
Function:
- - func[3] sig=1
- - func[4] sig=2
+ - func[3] sig=1 <$name1>
+ - func[4] sig=2 <$name2>
- func[5] sig=2
- - func[6] sig=3
+ - func[6] sig=3 <$name3>
Export:
- func[3] <$name1> -> "foo"
- func[6] <$name3> -> "baz"
diff --git a/test/link/names_import_only.txt b/test/link/names_import_only.txt
index c0e40449..96f7cb1d 100644
--- a/test/link/names_import_only.txt
+++ b/test/link/names_import_only.txt
@@ -18,7 +18,7 @@ Section Details:
Type:
- [0] () -> nil
Import:
- - func[0] sig=0 <- __extern.baz
+ - func[0] sig=0 <$import_func1> <- __extern.baz
Custom:
- name: "name"
- func[0] $import_func1
diff --git a/test/link/names_import_only_module_env.txt b/test/link/names_import_only_module_env.txt
index 398b4e01..75e705ee 100644
--- a/test/link/names_import_only_module_env.txt
+++ b/test/link/names_import_only_module_env.txt
@@ -18,7 +18,7 @@ Section Details:
Type:
- [0] () -> nil
Import:
- - func[0] sig=0 <- env.baz
+ - func[0] sig=0 <$import_func1> <- env.baz
Custom:
- name: "name"
- func[0] $import_func1