1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00
llvm-mirror/unittests
Greg Clayton 4dc036b075 Add the ability to extract the unwind rows from DWARF Call Frame Information.
This patch adds the ability to evaluate the state machine for CIE and FDE unwind objects and produce a UnwindTable with all UnwindRow objects needed to unwind registers. It will also dump the UnwindTable for each CIE and FDE when dumping DWARF .debug_frame or .eh_frame sections in llvm-dwarfdump or llvm-objdump. This allows users to see what the unwind rows actually look like for a given CIE or FDE instead of just seeing a list of opcodes.

This patch adds new classes: UnwindLocation, RegisterLocations, UnwindRow, and UnwindTable.

UnwindLocation is a class that describes how to unwind a register or Call Frame Address (CFA).

RegisterLocations is a class that tracks registers and their UnwindLocations. It gets populated when parsing the DWARF call frame instruction opcodes for a unwind row. The registers are mapped from their register numbers to the UnwindLocation in a map.

UnwindRow contains the result of evaluating a row of DWARF call frame instructions for the CIE, or a row from a FDE. The CIE can produce a set of initial instructions that each FDE that points to that CIE will use as the seed for the state machine when parsing FDE opcodes. A UnwindRow for a CIE will not have a valid address, whille a UnwindRow for a FDE will have a valid address.

The UnwindTable is a class that contains a sorted (by address) vector of UnwindRow objects and is the result of parsing all opcodes in a CIE, or FDE. Parsing a CIE should produce a UnwindTable with a single row. Parsing a FDE will produce a UnwindTable with one or more UnwindRow objects where all UnwindRow objects have valid addresses. The rows in the UnwindTable will be sorted from lowest Address to highest after parsing the state machine, or an error will be returned if the table isn't sorted. To parse a UnwindTable clients can use the following methods:

    static Expected<UnwindTable> UnwindTable::create(const CIE *Cie);
    static Expected<UnwindTable> UnwindTable::create(const FDE *Fde);

A valid table will be returned if the DWARF call frame instruction opcodes have no encoding errors. There are a few things that can go wrong during the evaluation of the state machine and these create functions will catch and return them.

Differential Revision: https://reviews.llvm.org/D89845
2021-01-28 13:39:17 -08:00
..
ADT ADT: Use 'using' to inherit assign and append in SmallString 2021-01-22 16:17:58 -08:00
Analysis [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
AsmParser [SVE] Remove calls to VectorType::getNumElements from AsmParserTest 2020-07-07 14:55:42 -07:00
BinaryFormat [BinaryFormat] Add formatv support for DW_OP constants 2020-06-08 15:27:44 +02:00
Bitcode [AMDGPU] Set the default globals address space to 1 2020-11-20 15:46:53 +00:00
Bitstream Switch from llvm::is_trivially_copyable to std::is_trivially_copyable 2020-12-02 22:02:48 -08:00
CodeGen [GlobalISel] Implement computeKnownBits for G_SEXT_INREG 2021-01-26 15:01:38 -08:00
DebugInfo Add the ability to extract the unwind rows from DWARF Call Frame Information. 2021-01-28 13:39:17 -08:00
Demangle Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ExecutionEngine [ORC] Move OrcError.h to include/llvm/ExecutionEngine/Orc/Shared. 2021-01-19 16:18:00 +11:00
FileCheck Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
Frontend Fix sign-comparison warnings in unit test EXPECTs 2021-01-24 18:38:16 -08:00
FuzzMutate [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
InterfaceStub [llvm] Fix ODRViolations for VersionTuple YAML specializations NFC 2020-10-20 18:29:15 -07:00
IR Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124 2021-01-07 14:18:19 -08:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MC [MC] Adjust StringTableBuilder for linked Mach-O binaries 2020-10-22 19:19:41 -07:00
MI [AMDGPU] Add _e64 suffix to VOP3 Insts 2021-01-12 18:33:18 -05:00
Object [llvm-readelf/obj] - Add support of multiple SHT_SYMTAB_SHNDX sections. 2021-01-13 11:36:43 +03:00
ObjectYAML Add -Wno-error=unknown flag to clang-format. 2020-09-19 10:17:57 +02:00
Option [clang][cli] Accept strings instead of options in ImpliedByAnyOf 2021-01-26 09:30:36 +01:00
Passes Don't export symbols from clang/opt/llc if plugins are disabled. 2020-03-23 12:17:09 -07:00
ProfileData [llvm] [unittests] Remove temporary files after they're not needed 2020-09-02 00:34:44 +03:00
Remarks [Remarks] Fix error message check in unit test 2019-10-31 15:51:36 -07:00
Support Support: Remove duplicated code in {File,clang::ModulesDependency}Collector, NFC 2021-01-25 15:09:00 -08:00
TableGen [TableGen] Eliminte source location from CodeInit 2020-11-23 11:30:13 -05:00
Target [NFC][AMDGPU] Split AMDGPUSubtarget.h to R600 and GCN subtargets 2021-01-20 22:22:45 +03:00
TextAPI [RGT][TextAPI] Remove a zero-trip loop and the assertions within it 2021-01-22 15:07:41 -08:00
tools [llvm-exegesis][PowerPC] Add more register classes 2020-12-04 15:02:12 +00:00
Transforms [LoopVectorize] use IR fast-math-flags exclusively (not FP function attributes) 2021-01-27 14:17:11 -05:00
XRay Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
CMakeLists.txt Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
unittest.cfg.in Add support for unittest inputs. 2018-09-05 23:30:17 +00:00