1. [Windows] Use information from the PE32 exceptions directory to (details)
Commit 30c2441a3262228990b5317eb3bc2b24ff06d316 by aleksandr.urakov
[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
processes chained infos transparently);
- EHProgramBuilder with the use of UnwindCodesIterator constructs
- EHProgram is, by fact, a vector of EHInstructions. It creates an
over the low-level unwind codes and simplifies work with them. It
only the information that is relevant to unwinding in the unified form.
the required unwind codes are read from the object file only once with
- 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:
llvm-svn: 374528
The file was modifiedlldb/unittests/ObjectFile/CMakeLists.txt
The file was addedlldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
The file was modifiedlldb/include/lldb/Symbol/UnwindTable.h
The file was modifiedlldb/source/Symbol/FuncUnwinders.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
The file was modifiedlldb/include/lldb/Symbol/ObjectFile.h
The file was modifiedlldb/source/Symbol/ObjectFile.cpp
The file was modifiedlldb/include/lldb/Symbol/FuncUnwinders.h
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
The file was addedlldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.h
The file was modifiedlldb/include/lldb/lldb-forward.h
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
The file was addedlldb/include/lldb/Symbol/CallFrameInfo.h
The file was addedlldb/unittests/ObjectFile/PECOFF/CMakeLists.txt
The file was addedlldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp
The file was modifiedlldb/source/Symbol/UnwindTable.cpp
The file was modifiedllvm/include/llvm/Support/Win64EH.h