[PATCH] D57695: [llvm-readobj] Report more WebAssembly symbol info
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 4 09:23:53 PST 2019
sbc100 created this revision.
Herald added subscribers: llvm-commits, rupprecht, sunfish, aheejin, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 added a reviewer: dschuff.
Repository:
rL LLVM
https://reviews.llvm.org/D57695
Files:
test/MC/WebAssembly/debug-info.ll
tools/llvm-readobj/WasmDumper.cpp
Index: tools/llvm-readobj/WasmDumper.cpp
===================================================================
--- tools/llvm-readobj/WasmDumper.cpp
+++ 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
Index: test/MC/WebAssembly/debug-info.ll
===================================================================
--- test/MC/WebAssembly/debug-info.ll
+++ 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:]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57695.185069.patch
Type: text/x-patch
Size: 2565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190204/a69c3e72/attachment.bin>
More information about the llvm-commits
mailing list