[PATCH] D102316: [symbolizer] Added StartAddress for the resolved function.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 09:18:47 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:1067-1069
+  if (auto LowPcAddr = toSectionedAddress(DIE.find(DW_AT_low_pc))) {
+    StartAddress = LowPcAddr->Address;
+  }
----------------
jhenderson wrote:
> dblaikie wrote:
> > jhenderson wrote:
> > > No need for braces for single-line if statements.
> > Any thoughts on the behavior you want if a function has more than one code range (eg: PROPELLER or other uses of basic block sections - where the function will described with DW_AT_ranges instead of DW_AT_low_pc)?
> I've got no concrete preference here currently, but I can think of the following options:
> 1) In such cases, don't print a StartAddress, to avoid confusion.
> 2) Print the start of the current block in the range.
> 3) Print the start of the first block (if possible), since that's technically the start address, and also the most likely entry point of the function.
> 4) Print the details of all ranges related to this symbol.
Yeah, I'm OK with any of that - though (3) isn't really possible with LLVM's DWARF output - the list of blocks isn't ordered, so you can't find the first one only from inspecting the address ranges. (yes, I'm pretty sure in LLVM's output the first block in the list of ranges is the start of the function, but nothing in DWARF communicates/guarantees that) - there's a separate attribute that can be emitted on subprograms that's for the entry point address which could be used for this (or you can lookup the symbol table - if the function/executable has a symbol table - and use that address)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102316



More information about the llvm-commits mailing list