[PATCH] D125783: [llvm-debuginfo-analyzer] 08 - ELF Reader

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 03:07:12 PDT 2022


CarlosAlbertoEnciso added inline comments.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h:173
 
+bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
+                           DIDumpOptions DumpOpts, uint8_t Opcode,
----------------
probinson wrote:
> This declaration puts the function into the `llvm` namespace which is inappropriate.
> I would rather see this become a static public method inside DWARFExpression.
> 
Changed `prettyPrintRegisterOp` as a `DWARFExpression` static public member.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h:570
   /// parseDWO - Parses .dwo file for current compile unit. Returns true if
   /// it was actually constructed.
+  bool parseDWO(StringRef AlternativeLocation = {});
----------------
probinson wrote:
> Say something about the parameter here.
Added:
```
  /// The \p AlternativeLocation specifies an alternative location to get
  /// the DWARF context for the DWO object; this is the case when it has
  /// been moved from its original location.
```


================
Comment at: llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h:403
+  // the low-pc and high-pc for those scopes that are marked as public, in
+  // order to support DWARF and CodeView.
+  LVPublicNames PublicNames;
----------------
probinson wrote:
> DWARF v5 added .debug_names, does the tool support that section?
Short answer is no.

Both readers (ELF/CodeView) use the public names information to create the instructions (LVLineAssembler). Instead of relying on differents DWARF section names (.debug_pubnames, .debug_names) and formats (CodeView S_PUB32), the reader collects the needed information in `LVELFReader::processOneDie` for DWARF and `LVSymbolVisitor::visitKnownRecord(CVSymbol &Record, ProcSym &Proc)` for CodeView S_GPROC32, S_LPROC32, S_LPROC32_ID, S_GPROC32_ID records.

A future task can be to process the respective sections for DWARF (.debug_pubnames, .debug_names) and CodeView public symbol stream.


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

https://reviews.llvm.org/D125783



More information about the llvm-commits mailing list