[Lldb-commits] [PATCH] D80519: [lldb/DWARF] Add support for pre-standard GNU call site attributes

Vedant Kumar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 26 13:05:40 PDT 2020


vsk added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3740
+      if (tail_call)
+        call_inst_pc = low_pc;
+      else
----------------
I think this needs to be `call_inst_pc = low_pc - 1`, see `DwarfCompileUnit::constructCallSiteEntryDIE` for the rationale, and `StackFrameList::SynthesizeTailCallFrames` for where we use this information. The relevant part of the comment from SynthesizeTailCallFrames is:

"We do not want to subtract 1 from this PC, as it's the actual address of the tail-calling branch instruction. This address is provided by the compiler via DW_AT_call_pc."

In GNU+Dwarf4 mode, that's no longer true, the DW_AT_low_pc is a fake "return address" for the tail call (really: the address of the instruction after the tail-calling jump).

On x86_64, this test doesn't seem to stress this case, but the test breaks on Darwin/arm64 without the adjustment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80519





More information about the lldb-commits mailing list