llvm-project/lldb/source/Plugins/Process/Utility
Fred Riss b40ee7ff1b [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces
Summary:
The memory history plugin for Asan creates a HistoryThread with the
recorded PC values provided by the Asan runtime. In other cases,
thoses PCs are gathered by LLDB directly.

The PCs returned by the Asan runtime are the PCs of the calls in the
backtrace, not the return addresses you would normally get when
unwinding the stack (look for a call to GetPreviousIntructionPc in
AsanGetStack).

When the above addresses are passed to the unwinder, it will subtract
1 from each address of the non zero frames because it treats them as
return addresses. This can lead to the final report referencing the
wrong line.

This patch fixes this issue by threading a flag through HistoryThread
and HistoryUnwinder that tells them to treat every frame like the
first one. The Asan MemoryHistory plugin can then use this flag.

This fixes running TestMemoryHistory on arm64 devices, although it's
hard to guarantee that the test will continue to exhibit the boundary
condition that triggers this bug.

Reviewers: jasonmolenda, kubamracek

Subscribers: kristof.beyls, danielkiss, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76341
2020-03-18 13:18:02 -07:00
..
ARMDefines.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
ARMUtils.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
AuxVector.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AuxVector.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
CMakeLists.txt [lldb] Make UnwindLLDB a non-plugin 2020-03-10 13:56:15 +01:00
DynamicRegisterInfo.cpp [lldb] Make comparing RegisterInfo::[alt_]name's pointer value less footy-shooty 2020-02-19 13:19:41 +01:00
DynamicRegisterInfo.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
FreeBSDSignals.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FreeBSDSignals.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
GDBRemoteSignals.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
GDBRemoteSignals.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
HistoryThread.cpp [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces 2020-03-18 13:18:02 -07:00
HistoryThread.h [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces 2020-03-18 13:18:02 -07:00
HistoryUnwind.cpp [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces 2020-03-18 13:18:02 -07:00
HistoryUnwind.h [lldb/MemoryHistoryAsan] Fix address resolution for recorded backtraces 2020-03-18 13:18:02 -07:00
InferiorCallPOSIX.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
InferiorCallPOSIX.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
InstructionUtils.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LinuxProcMaps.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LinuxProcMaps.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LinuxSignals.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LinuxSignals.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
MipsLinuxSignals.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
MipsLinuxSignals.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
NativeRegisterContextRegisterInfo.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
NativeRegisterContextRegisterInfo.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
NetBSDSignals.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
NetBSDSignals.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDarwinConstants.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDarwin_arm.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextDarwin_arm.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDarwin_arm64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextDarwin_arm64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDarwin_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextDarwin_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDarwin_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextDarwin_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextDummy.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextDummy.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextFreeBSD_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextFreeBSD_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextFreeBSD_mips64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextFreeBSD_mips64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextFreeBSD_powerpc.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextFreeBSD_powerpc.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextFreeBSD_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextFreeBSD_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextHistory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextHistory.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextLinux_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextLinux_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextLinux_mips.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextLinux_mips.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextLinux_mips64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextLinux_mips64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextLinux_s390x.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextLinux_s390x.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextLinux_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextLinux_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextMach_arm.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextMach_arm.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextMach_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextMach_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextMach_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextMach_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextMemory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextMemory.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextNetBSD_i386.cpp [lldb] Introduce i386 support in NetBSD Process plugin 2020-02-05 13:31:06 +01:00
RegisterContextNetBSD_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextNetBSD_x86_64.cpp [lldb] Improve debugging 32-bit programs on NetBSD/amd64 2020-02-07 17:48:33 +01:00
RegisterContextNetBSD_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextOpenBSD_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextOpenBSD_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextOpenBSD_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextOpenBSD_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_arm.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_arm.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_arm64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_arm64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_mips64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_mips64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_powerpc.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_powerpc.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_ppc64le.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_ppc64le.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_s390x.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_s390x.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextPOSIX_x86.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextPOSIX_x86.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextThreadMemory.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextThreadMemory.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextWindows_i386.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextWindows_i386.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContextWindows_x86_64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterContextWindows_x86_64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContext_mips.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContext_powerpc.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContext_s390x.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterContext_x86.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterInfoInterface.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterInfoPOSIX_arm.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterInfoPOSIX_arm.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterInfoPOSIX_arm64.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterInfoPOSIX_arm64.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterInfoPOSIX_ppc64le.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
RegisterInfoPOSIX_ppc64le.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
RegisterInfos_arm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_arm64.h [ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array 2019-09-02 11:53:29 +00:00
RegisterInfos_i386.h [lldb] Introduce i386 support in NetBSD Process plugin 2020-02-05 13:31:06 +01:00
RegisterInfos_mips.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_mips64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_powerpc.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_ppc64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_ppc64le.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_s390x.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfos_x86_64.h [lldb] Fix offset intersection bug between MPX and AVX registers 2019-10-31 10:58:17 +01:00
StopInfoMachException.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
StopInfoMachException.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
ThreadMemory.cpp [lldb] Return Unwinder& from Thread::GetUnwinder 2020-03-09 14:13:22 +01:00
ThreadMemory.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-arm-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-arm64-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-mips-freebsd-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-mips-linux-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-ppc64-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-ppc64le-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-s390x-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
lldb-x86-register-enums.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00