[PATCH] D53469: [DWARF] Use a function-local offset for AT_call_return_pc
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 19 18:56:37 PDT 2018
vsk created this revision.
vsk added reviewers: aprantl, JDevlieghere, stella.stamenova, jingham.
Herald added a subscriber: hiraditya.
This is a speculative fix for tail call frame support on Linux.
Logs provided by @stella.stamenova indicate that on Linux, lldb adds a spurious slide offset to the return PC it loads from AT_call_return_pc attributes (see the list thread: "[PATCH] https://reviews.llvm.org/D50478: Add support for artificial tail call frames").
This patch side-steps the issue by getting rid of the load address calculation in lldb's CallEdge::GetReturnPCAddress.
The idea is to have the DWARF writer emit function-local offsets to the instruction after a call. I.e. `return-pc = label-after-call-insn - function-entry`. LLDB can simply add this offset to the base address of a function to get the return PC.
I'm open to other ideas here. I've tested that this works on Darwin, but not on Linux.
https://reviews.llvm.org/D53469
Files:
lldb/include/lldb/Symbol/Function.h
lldb/source/Symbol/Function.cpp
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53469.170295.patch
Type: text/x-patch
Size: 7748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181020/db8b09a9/attachment.bin>
More information about the llvm-commits
mailing list