[PATCH] D131115: [Symbolizer] Implement pc element in symbolizing filter.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 10:43:46 PDT 2022


peter.smith added a comment.

Implementation looks good to me. One quick question to clarify my understanding.



================
Comment at: llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp:255
+  // instruction.
+  if (Type && *Type == MarkupFilter::PCType::RETURN_ADDRESS)
+    --*Addr;
----------------
Just wanted to check my understanding of whether it is important when subtracting from `Addr` to land on the start of an instruction? My guess is not, as it would be difficult on a variable length instruction set.

Reading the documentation for `ra` in the backtrace section:
`the symbolizing filter will subtract one byte or one instruction length from the actual return address for the call site`
It looks like from the test case
```
       4: e8 00 00 00 00         callq   0x9 <first+0x9> // Line 4
       9: 5d                            popq    %rbp                 // Line 5
```
That address 9 - 1 is within the callq instruction and not the start yet it still displays line 4 so it all looks OK.

On AArch64 it would be possible to subtract 4 as all instructions are 4-bytes, but no need if subtracting 1 will work.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131115



More information about the llvm-commits mailing list