llvm-project/lldb/source/Plugins
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
..
ABI [lldb] Use llvm::MC for register numbers in AArch64 ABIs 2020-05-14 13:31:48 +02:00
Architecture [lldb] Reduce duplication in the Disassembler class 2020-03-09 13:41:43 +01:00
Disassembler [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
DynamicLoader Remove redundant code (NFC) 2020-06-02 16:55:50 -07:00
ExpressionParser SmallPtrSet::find -> SmallPtrSet::count 2020-06-07 22:38:08 +02:00
Instruction [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
InstrumentationRuntime [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers 2020-02-18 08:58:36 +01:00
JITLoader [lldb] Remove DataExtractor::GetPointer 2020-02-18 10:38:41 +01:00
Language Revert "[lldb/DataFormatter] Check for overflow when finding NSDate epoch" 2020-05-20 12:44:19 +02:00
LanguageRuntime [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
MemoryHistory [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces 2020-03-18 13:18:02 -07:00
ObjectContainer Replace std::string::find == 0 with StringRef::startswith 2020-03-31 21:01:09 +02:00
ObjectFile Support build-ids of other sizes than 16 in UUID::SetFromStringRef 2020-06-07 10:03:41 +00:00
OperatingSystem [lldb/Plugins] Conditionally build OperatingSystemPython. 2020-02-17 21:22:37 -08:00
Platform Move GetXcode*Directory into HostInfo (NFC) 2020-06-05 11:59:22 -07:00
Process Support build-ids of other sizes than 16 in UUID::SetFromStringRef 2020-06-07 10:03:41 +00:00
ScriptInterpreter [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
StructuredData [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
SymbolFile [lldb/DWARF] Fix PC value for artificial tail call frames for the "GNU" case 2020-06-08 14:44:36 +02:00
SymbolVendor [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
SystemRuntime [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
TypeSystem PR46209: properly determine whether a copy assignment operator is 2020-06-05 16:05:32 -07:00
UnwindAssembly [lldb] NFC remove DISALLOW_COPY_AND_ASSIGN 2020-06-02 13:23:53 -04:00
CMakeLists.txt Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin" 2020-02-18 19:16:07 -08:00
Plugins.def.in Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin" 2020-02-18 19:16:07 -08:00