llvm-project/lldb/source/Symbol
Pavel Labath 0081149f96 [lldb/DWARF] Fix PC value for artificial tail call frames for the "GNU" case
Summary:
The way that the support for the GNU dialect of tail call frames was
implemented in D80519 meant that the were reporting very bogus PC values
which pointed into the middle of an instruction: the -1 trick is
necessary for the address to resolve to the right function, but we
should still be reporting a more realistic PC value -- I say "realistic"
and not "real", because it's very debatable what should be the correct
PC value for frames like this.

This patch achieves that my moving the -1 from SymbolFileDWARF into the
stack frame computation code. The idea is that SymbolFileDWARF will
merely report whether it has provided an address of the instruction
after the tail call, or the address of the call instruction itself. The
StackFrameList machinery uses this information to set the "behaves like
frame zero" property of the artificial frames (the main thing this flag
does is it controls the -1 subtraction when looking up the function
address).

This required a moderate refactor of the CallEdge class, because it was
implicitly assuming that edges pointing after the call were real calls
and those pointing the the call insn were tail calls. The class now
carries this information explicitly -- it carries three mostly
independent pieces of information:
- an address of interest in the caller
- a bit saying whether this address points to the call insn or after it
- whether this is a tail call

Reviewers: vsk, dblaikie

Subscribers: aprantl, mgrang, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D81010
2020-06-08 14:44:36 +02:00
..
ArmUnwindInfo.cpp [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
Block.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CMakeLists.txt [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
CompactUnwindInfo.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompileUnit.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompilerDecl.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompilerDeclContext.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompilerType.cpp Allow lldb-test to combine -find with -dump-clang-ast 2020-04-17 11:01:20 -07:00
DWARFCallFrameInfo.cpp [lldb] Remove DataExtractor::GetPointer 2020-02-18 10:38:41 +01:00
DebugMacros.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DeclVendor.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Declaration.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FuncUnwinders.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Function.cpp [lldb/DWARF] Fix PC value for artificial tail call frames for the "GNU" case 2020-06-08 14:44:36 +02:00
LineEntry.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LineTable.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LocateSymbolFile.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LocateSymbolFileMacOSX.cpp [lldb/Symbol] Reimplement Symbols::FindSymbolFileInBundle to use the VFS 2020-04-03 09:29:22 -07:00
ObjectFile.cpp [lldb] Add boilerplate to recognize the .debug_tu_index section 2020-02-20 13:44:21 +01:00
PostfixExpression.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol.cpp [lldb] s/ExecutionContext/Target in Disassembler 2020-03-05 14:46:39 +01:00
SymbolContext.cpp [lldb][NFCI] Remove unused LanguageType parameters 2020-01-30 21:57:23 -08:00
SymbolFile.cpp [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers 2020-02-18 08:58:36 +01:00
SymbolVendor.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symtab.cpp [lldb][NFCI] Remove unused LanguageType parameters 2020-01-30 21:57:23 -08:00
Type.cpp Allow lldb-test to combine -find with -dump-clang-ast 2020-04-17 11:01:20 -07:00
TypeList.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeMap.cpp Allow lldb-test to combine -find with -dump-clang-ast 2020-04-17 11:01:20 -07:00
TypeSystem.cpp Preserve the owning module information from DWARF in the synthesized AST 2020-04-09 11:09:44 -07:00
UnwindPlan.cpp [lldb] Remove custom DWARF expression printing code 2020-05-25 16:09:25 +02:00
UnwindTable.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Variable.cpp Replace std::string::find == 0 with StringRef::startswith 2020-03-31 21:01:09 +02:00
VariableList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00