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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 00:32:33 PDT 2021


jhenderson added a comment.

In D102316#2757821 <https://reviews.llvm.org/D102316#2757821>, @aorlov wrote:

>> it could just be part of the verbose output (since that is where the `StartLine` output is printed.
>
> I like this more. Feels like we already have enough options.
>
> What about compatibility with gnu adr2line? Unless I’m missing something, they do not offer such data. Do we care?

We definitely care about GNU compatibility for the GNU output style. There are two options here: 1) discuss on the GNU binutils mailing list whether they'd be interested in implementing the same feature, maybe with a concrete proposal of what the output would look like - if they accept it, model our output on theirs. 2) Add the output to the LLVM-style verbose output only (also to JSON output of course).

Don't forget to update the examples (and potentially text) in the docs to match whatever the new output is.



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:1067-1069
+  if (auto LowPcAddr = toSectionedAddress(DIE.find(DW_AT_low_pc))) {
+    StartAddress = LowPcAddr->Address;
+  }
----------------
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.


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