llvm-project/lldb/source/Plugins/Process/Utility
Aleksandr Urakov 30c2441a32 [Windows] Use information from the PE32 exceptions directory to construct unwind plans
This patch adds an implementation of unwinding using PE EH info. It allows to
get almost ideal call stacks on 64-bit Windows systems (except some epilogue
cases, but I believe that they can be fixed with unwind plan disassembly
augmentation in the future).

To achieve the goal the CallFrameInfo abstraction was made. It is based on the
DWARFCallFrameInfo class interface with a few changes to make it less
DWARF-specific.

To implement the new interface for PECOFF object files the class PECallFrameInfo
was written. It uses the next helper classes:

- UnwindCodesIterator helps to iterate through UnwindCode structures (and
  processes chained infos transparently);
- EHProgramBuilder with the use of UnwindCodesIterator constructs EHProgram;
- EHProgram is, by fact, a vector of EHInstructions. It creates an abstraction
  over the low-level unwind codes and simplifies work with them. It contains
  only the information that is relevant to unwinding in the unified form. Also
  the required unwind codes are read from the object file only once with it;
- EHProgramRange allows to take a range of EHProgram and to build an unwind row
  for it.

So, PECallFrameInfo builds the EHProgram with EHProgramBuilder, takes the ranges
corresponding to every offset in prologue and builds the rows of the resulted
unwind plan. The resulted plan covers the whole range of the function except the
epilogue.

Reviewers: jasonmolenda, asmith, amccarth, clayborg, JDevlieghere, stella.stamenova, labath, espindola

Reviewed By: jasonmolenda

Subscribers: leonid.mashinskiy, emaste, mgorny, aprantl, arichardson, MaskRay, lldb-commits, llvm-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67347

llvm-svn: 374528
2019-10-11 09:03:29 +00:00
..
ARMDefines.h typedef enum -> enum 2019-05-14 08:55:50 +00:00
ARMUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AuxVector.cpp [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
AuxVector.h Add support to read aux vector values 2019-06-11 20:16:13 +00:00
CMakeLists.txt Initial support for native debugging of x86/x64 Windows processes 2019-08-13 22:18:01 +00:00
DynamicRegisterInfo.cpp [Utility] Reimplement RegularExpression on top of llvm::Regex 2019-08-16 21:25:36 +00:00
DynamicRegisterInfo.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
FreeBSDSignals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FreeBSDSignals.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GDBRemoteSignals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GDBRemoteSignals.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
HistoryThread.cpp [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
HistoryThread.h [Process] Remove unused field from HistoryThread 2019-06-19 21:33:44 +00:00
HistoryUnwind.cpp Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
HistoryUnwind.h Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
InferiorCallPOSIX.cpp [Target] Move InferiorCall to Process 2019-09-13 00:02:05 +00:00
InferiorCallPOSIX.h [Target] Move InferiorCall to Process 2019-09-13 00:02:05 +00:00
InstructionUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LinuxProcMaps.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LinuxProcMaps.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LinuxSignals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LinuxSignals.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MipsLinuxSignals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MipsLinuxSignals.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NativeRegisterContextRegisterInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NativeRegisterContextRegisterInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NetBSDSignals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NetBSDSignals.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextDarwinConstants.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextDarwin_arm.cpp [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
RegisterContextDarwin_arm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextDarwin_arm64.cpp [RegisterContextDarwin_arm64] Include the headers for getsysctlbyname. 2019-10-02 19:20:21 +00:00
RegisterContextDarwin_arm64.h [NFC] avoid AlignedCharArray in lldb 2019-07-29 23:17:08 +00:00
RegisterContextDarwin_i386.cpp [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
RegisterContextDarwin_i386.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextDarwin_x86_64.cpp [Logging] Replace LogIfAnyCategoriesSet with LLDB_LOG. 2019-07-22 23:48:01 +00:00
RegisterContextDarwin_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextDummy.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextDummy.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextFreeBSD_i386.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextFreeBSD_i386.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextFreeBSD_mips64.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextFreeBSD_mips64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextFreeBSD_powerpc.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextFreeBSD_powerpc.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextFreeBSD_x86_64.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextFreeBSD_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextHistory.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextHistory.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextLLDB.cpp [Windows] Use information from the PE32 exceptions directory to construct unwind plans 2019-10-11 09:03:29 +00:00
RegisterContextLLDB.h Unwind: Add a stack scanning mechanism to support win32 unwinding 2019-09-27 12:10:06 +00:00
RegisterContextLinux_i386.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextLinux_i386.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextLinux_mips.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextLinux_mips.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextLinux_mips64.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextLinux_mips64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextLinux_s390x.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextLinux_s390x.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextLinux_x86_64.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextLinux_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMacOSXFrameBackchain.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextMacOSXFrameBackchain.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_arm.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_arm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_i386.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_i386.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_x86_64.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMach_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextMemory.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextMemory.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextNetBSD_x86_64.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextNetBSD_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextOpenBSD_i386.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextOpenBSD_i386.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextOpenBSD_x86_64.cpp [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextOpenBSD_x86_64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextPOSIX_arm.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_arm.h Replace 'ap' with 'up' suffix in variable names. (NFC) 2019-02-13 06:25:41 +00:00
RegisterContextPOSIX_arm64.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_arm64.h Replace 'ap' with 'up' suffix in variable names. (NFC) 2019-02-13 06:25:41 +00:00
RegisterContextPOSIX_mips64.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_mips64.h Replace 'ap' with 'up' suffix in variable names. (NFC) 2019-02-13 06:25:41 +00:00
RegisterContextPOSIX_powerpc.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_powerpc.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextPOSIX_ppc64le.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_ppc64le.h Replace 'ap' with 'up' suffix in variable names. (NFC) 2019-02-13 06:25:41 +00:00
RegisterContextPOSIX_s390x.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextPOSIX_s390x.h Replace 'ap' with 'up' suffix in variable names. (NFC) 2019-02-13 06:25:41 +00:00
RegisterContextPOSIX_x86.cpp [lldb] [Process] Introduce common helpers to split/recombine YMM data 2019-06-21 13:19:34 +00:00
RegisterContextPOSIX_x86.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContextThreadMemory.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterContextThreadMemory.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContextWindows_i386.cpp Initial support for native debugging of x86/x64 Windows processes 2019-08-13 22:18:01 +00:00
RegisterContextWindows_i386.h Initial support for native debugging of x86/x64 Windows processes 2019-08-13 22:18:01 +00:00
RegisterContextWindows_x86_64.cpp Fix warning: suggest braces around initialization of subobject 2019-08-14 01:25:10 +00:00
RegisterContextWindows_x86_64.h Initial support for native debugging of x86/x64 Windows processes 2019-08-13 22:18:01 +00:00
RegisterContext_mips.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContext_powerpc.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterContext_s390x.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterContext_x86.h [lldb] [Process] Introduce common helpers to split/recombine YMM data 2019-06-21 13:19:34 +00:00
RegisterInfoInterface.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
RegisterInfoPOSIX_arm.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterInfoPOSIX_arm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfoPOSIX_arm64.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterInfoPOSIX_arm64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfoPOSIX_ppc64le.cpp [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
RegisterInfoPOSIX_ppc64le.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00: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 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00: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 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StopInfoMachException.cpp StopInfo/Mach: Delete PPC support 2019-10-08 20:47:44 +00:00
StopInfoMachException.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
ThreadMemory.cpp Use std::make_shared in LLDB (NFC) 2019-02-11 23:13:08 +00:00
ThreadMemory.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UnwindLLDB.cpp Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
UnwindLLDB.h Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
UnwindMacOSXFrameBackchain.cpp Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
UnwindMacOSXFrameBackchain.h Fix PC adjustment in StackFrame::GetSymbolContext 2019-08-02 16:53:42 +00:00
lldb-arm-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-arm64-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-mips-freebsd-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-mips-linux-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-ppc64-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-ppc64le-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-s390x-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-x86-register-enums.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00