[PATCH] D50005: [DWARF] Basic support for producing DWARFv5 .debug_addr section

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 18:47:17 PDT 2018


dblaikie added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2299-2307
+// Emit DWO addresses.
+void DwarfDebug::emitDebugAddr() {
+  assert(useSplitDwarf() && "No split dwarf?");
+  MCSection *Section = Asm->getObjFileLowering().getDwarfAddrSection();
+  if (Asm->getDwarfVersion() >= 5)
+    AddrPool.emitHeader(*Asm, Section);
+  AddrPool.emit(*Asm, Section);
----------------
I'd sink this functionality down into AddressPool::emit instead - it can query the AsmPrinter for DWARF version & decide what format to produce the address pool in internally.


================
Comment at: test/DebugInfo/X86/debug_addr.ll:9
+; void foo() {
+;   return;
+; }
----------------
These return statements seem unnecessary? (in the text of this comment, and in the IR of the sample - not that it'd make much of a difference)


================
Comment at: test/DebugInfo/X86/debug_addr.ll:24
+; DWARF4: .debug_addr contents:
+; DWARF4-NEXT: 0x00000000: Addr Section params: length = 0x00000000, version = 0x0004, addr_size = 0x04, seg_size = 0x00
+; DWARF4-NEXT: Addrs: [
----------------
There's no header in debug_addr sections in DWARFv4, is there - what's this then?

Also is this consistent with the way other section contributions are described (I don't recall text like "Addr Section params" in other output - like the way those attributes are printed out like "Compile Unit: ..." rather than "Unit Section params")?


https://reviews.llvm.org/D50005





More information about the llvm-commits mailing list