[PATCH] D57695: [llvm-readobj] Report more WebAssembly symbol info
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 4 14:27:33 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL353104: [llvm-readobj] Report more WebAssembly symbol info (authored by sbc, committed by ).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57695/new/
https://reviews.llvm.org/D57695
Files:
llvm/trunk/test/MC/WebAssembly/debug-info.ll
llvm/trunk/tools/llvm-readobj/WasmDumper.cpp
Index: llvm/trunk/test/MC/WebAssembly/debug-info.ll
===================================================================
--- llvm/trunk/test/MC/WebAssembly/debug-info.ll
+++ llvm/trunk/test/MC/WebAssembly/debug-info.ll
@@ -166,41 +166,53 @@
; CHECK-NEXT: Name: f2
; CHECK-NEXT: Type: FUNCTION (0x0)
; CHECK-NEXT: Flags: 0x4
+; CHECK-NEXT: ElementIndex: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: foo
; CHECK-NEXT: Type: DATA (0x1)
; CHECK-NEXT: Flags: 0x4
+; CHECK-NEXT: Offset: 0x0
+; CHECK-NEXT: Segment: 0x0
+; CHECK-NEXT: Size: 0x4
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: myextern
; CHECK-NEXT: Type: DATA (0x1)
; CHECK-NEXT: Flags: 0x10
+; CHECK-NEXT: Module:
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: ptr2
; CHECK-NEXT: Type: DATA (0x1)
; CHECK-NEXT: Flags: 0x4
+; CHECK-NEXT: Offset: 0x0
+; CHECK-NEXT: Segment: 0x1
+; CHECK-NEXT: Size: 0x4
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: .debug_str
; CHECK-NEXT: Type: SECTION (0x3)
; CHECK-NEXT: Flags: 0x2
+; CHECK-NEXT: ElementIndex: 0x6
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: .debug_abbrev
; CHECK-NEXT: Type: SECTION (0x3)
; CHECK-NEXT: Flags: 0x2
+; CHECK-NEXT: ElementIndex: 0x7
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: .debug_info
; CHECK-NEXT: Type: SECTION (0x3)
; CHECK-NEXT: Flags: 0x2
+; CHECK-NEXT: ElementIndex: 0x8
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: .debug_line
; CHECK-NEXT: Type: SECTION (0x3)
; CHECK-NEXT: Flags: 0x2
+; CHECK-NEXT: ElementIndex: 0xC
; CHECK-NEXT: }
; CHECK-NEXT:]
Index: llvm/trunk/tools/llvm-readobj/WasmDumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/WasmDumper.cpp
+++ llvm/trunk/tools/llvm-readobj/WasmDumper.cpp
@@ -210,6 +210,15 @@
W.printString("Name", Symbol.Info.Name);
W.printEnum("Type", Symbol.Info.Kind, makeArrayRef(WasmSymbolTypes));
W.printHex("Flags", Symbol.Info.Flags);
+ if (Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED)
+ W.printString("Module", Symbol.Info.Module);
+ if (Symbol.Info.Kind != wasm::WASM_SYMBOL_TYPE_DATA) {
+ W.printHex("ElementIndex", Symbol.Info.ElementIndex);
+ } else if (!(Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED)) {
+ W.printHex("Offset", Symbol.Info.DataRef.Offset);
+ W.printHex("Segment", Symbol.Info.DataRef.Segment);
+ W.printHex("Size", Symbol.Info.DataRef.Size);
+ }
}
} // namespace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57695.185161.patch
Type: text/x-patch
Size: 2631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190204/92e9e0ec/attachment.bin>
More information about the llvm-commits
mailing list