[PATCH] D73086: [DWARF5] Added support for debug_macro section parsing and dumping in llvm-dwarfdump.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 09:56:27 PST 2020


probinson added inline comments.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:281
   /// Get a pointer to the parsed dwo DebugMacro object.
   const DWARFDebugMacro *getDebugMacinfoDWO();
 
----------------
The name "MacinfoDWO" suggests the .dwo file has a .debug_macinfo section, rather than a .debug_macro section.  I have not been paying much attention to the .dwo stuff, but I'm a little surprised that you did not have to add a `getDebugMacroDWO()` method.
Or, if .dwo files always have .debug_macro and never .debug_macinfo, then perhaps this method should be renamed?


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h:54
+    //   a 64-bit DWARF format macro section
+    uint64_t DebugLineOffset;
+    // FIXME: add support for opcode_operands_table_flag.
----------------
> Can somebody help/explain this. ?? @probinson @aprantl
> Spec Pg. 144 Section 6.1.1.4.2 says ->
> "DWARF-32 format, a section offset is 4 bytes, while in the DWARF-64 format, a section offset is 8 bytes."

Most DWARF information has an "initial length" that indicates the 32/64 format.  The .debug_macro section does not have an initial length, so it uses a flag bit to indicate whether it is in 32/64 format.

Is that what you were asking about?


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp:155
+  // FIXME: Add support for DWARF64
+  if (Flagdata == MACRO_OFFSET_SIZE) {
+    Error Err =
----------------
You want to check only the single bit here, for example:
`if (Flagdata & MACRO_OFFSET_SIZE == 1)`



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73086/new/

https://reviews.llvm.org/D73086





More information about the llvm-commits mailing list