llvm-project/lldb/unittests
Adrian Prantl 188b0747c1 Support dereferencing a DWARF scalar stack value
Swift async functions receive function arguments inside a
heap-allocated data structure, similar to how ObjC block captures or
C++ coroutine arguments are implement. In DWARF they are described
relative to an entry value that produces a pointer into that heap
object. At typical location looks like

DW_OP_entry_value [ DW_OP_reg14 ] DW_OP_deref DW_OP_plus_uconst 32 DW_OP_deref

This allows the unwinder (which has special ABI knowledge to restore
the contents of r14) to push the base address onto the stack thus
allowing the deref/offset operations to continue. The result of the
entry value is a scalar, because DW_OP_reg14 is a register location —
as it should be since we want to restore the pointer value contained
in r14 at the beginning of the function and not the historical memory
contents it was pointing to. The entry value should restore the
address, which is still valid, not the contents at function entry.

To make this work, we need to allow LLDB to dereference Scalar stack
results like load addresses, which is what this patch
does. Unfortunately it is difficult to test this in isolation, since
the DWARFExpression unit test doesn't have a process.

Differential Revision: https://reviews.llvm.org/D96549
2021-02-12 16:12:32 -08:00
..
API [lldb] Get rid of helper CMake variables for Python 2020-08-17 08:47:52 -07:00
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb/Module] Allow for the creation of memory-only modules 2020-07-14 08:45:44 -07:00
DataFormatter Reland [lldb] Unify type name matching in FormattersContainer II 2020-07-23 18:17:42 +02:00
Disassembler [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Editline [lldb] Modernize PseudoTerminal::OpenSecondary 2020-10-16 15:22:55 +02:00
Expression Support dereferencing a DWARF scalar stack value 2021-02-12 16:12:32 -08:00
Host [lldb] Disable PipeTest.OpenAsReader on windows 2021-01-11 13:37:49 +01:00
Instruction Fix UB in EmulateInstructionARM64.cpp 2020-06-01 18:11:50 -07:00
Interpreter [lldb] Make TestOptionValueFileColonLine work on Windows 2020-07-20 23:15:03 -07:00
Language [lldb] Reactivate Objective-C++ plugin 2020-06-19 19:16:46 +02:00
ObjectFile [lldb/ObjectFileMachO] Fetch shared cache images from our own shared cache 2020-07-16 10:37:37 -07:00
Platform Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC) 2020-08-06 16:36:58 -07:00
Process [lldb] [Process/FreeBSDRemote] Introduce powerpc support 2021-02-09 21:10:45 +01:00
ScriptInterpreter [lldb/Lua] add support for Lua function breakpoint 2021-01-25 23:40:57 +00:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol [lldb] Unify the two CreateTypedef implementations in TypeSystemClang 2020-12-17 10:49:26 +01:00
SymbolFile [lldb] Fix XcodeSDKModuleTests 2020-10-30 23:08:35 -07:00
Target Fix -Wmissing-override in lldb 2021-01-25 15:04:21 -08:00
TestingSupport Fix an embarrasing use-after-free from a895a446bc 2020-10-30 16:54:24 +01:00
Thread Fix -Wmissing-override in lldb 2021-01-25 15:04:21 -08:00
UnwindAssembly Bug where insn-based unwind plans on arm64 could be wrong 2020-04-14 16:57:25 -07:00
Utility [lldb] Deal gracefully with concurrency in the API instrumentation. 2020-12-10 09:37:49 -08:00
debugserver [lldb] Fix -Wformat warning in debugserver unit test 2020-12-08 20:57:51 -08:00
tools Make offset field optional in RegisterInfo packet for Arm64 2020-12-02 03:19:43 +05:00
CMakeLists.txt Reapply "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories." 2020-07-22 17:50:19 -07:00
gtest_common.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00