1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/include/llvm
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 [APFloat] Remove orphan ilogb(DoubleAPFloat) declaration. NFCI. 2021-01-28 15:18:25 +00:00
Analysis [StackSafety] Use ListSeparator (NFC) 2021-01-25 19:23:59 -08:00
AsmParser
BinaryFormat DebugInfo: Add a DWARF FORM extension for addrx+offset references to reduce relocations 2021-01-28 10:20:02 -08:00
Bitcode Support for instrumenting only selected files or functions 2021-01-26 17:13:34 -08:00
Bitstream [llvm] Use isAlpha/isAlnum (NFC) 2021-01-22 23:25:03 -08:00
CodeGen DebugInfo: Add a DWARF FORM extension for addrx+offset references to reduce relocations 2021-01-28 10:20:02 -08:00
Config
DebugInfo Add the ability to extract the unwind rows from DWARF Call Frame Information. 2021-01-28 13:39:17 -08:00
Demangle Itanium Mangling: Mangle __alignof__ differently than alignof. 2021-01-27 16:46:51 -05:00
DWARFLinker [dsymutil] Add preliminary support for DWARF 5. 2021-01-12 21:55:41 -08:00
ExecutionEngine [Orc] Remove unused header from TPC server 2021-01-28 14:16:49 +01:00
FileCheck
Frontend [flang][openacc] Allow multiple wait clauses 2021-01-27 13:18:46 -05:00
FuzzMutate [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
InterfaceStub
IR [WebAssembly] Prototype i8x16 to i32x4 widening instructions 2021-01-28 10:59:32 -08:00
IRReader
LineEditor
Linker
LTO [LTO] Prevent devirtualization for symbols dynamically exported 2021-01-27 15:54:13 -08:00
MC Add -fbinutils-version= to gate ELF features on the specified binutils version 2021-01-26 12:28:23 -08:00
MCA
Object [FaultsMaps][llvm-objdump] Move FaultMapParser to Object/. Remove CodeGen dependency from llvm-objdump 2021-01-27 10:39:59 -08:00
ObjectYAML [yaml2obj] - Allow empty SectionHeaderTable definitions. 2021-01-28 10:51:52 +03:00
Option [clang][cli] Accept strings instead of options in ImpliedByAnyOf 2021-01-26 09:30:36 +01:00
Passes [NewPM][Inliner] Move the 'always inliner' case in the same CGSCC pass as 'regular' inliner 2021-01-15 17:59:38 -08:00
ProfileData [CSSPGO] Support of CS profiles in extended binary format. 2021-01-27 21:29:46 -08:00
Remarks
Support Frontend: Simplify handling of non-seeking streams in CompilerInstance, NFC 2021-01-26 15:20:43 -08:00
TableGen [llvm] Use isDigit (NFC) 2021-01-21 19:59:50 -08:00
Target Add -fbinutils-version= to gate ELF features on the specified binutils version 2021-01-26 12:28:23 -08:00
Testing/Support
TextAPI/MachO
ToolDrivers
Transforms [LTO] Prevent devirtualization for symbols dynamically exported 2021-01-27 15:54:13 -08:00
WindowsManifest
WindowsResource
XRay
CMakeLists.txt
InitializePasses.h [NFC][CodeGen] Split DwarfEHPrepare pass into an actual transform and an legacy-PM wrapper 2021-01-02 01:01:19 +03:00
LinkAllIR.h
LinkAllPasses.h
module.extern.modulemap
module.install.modulemap
module.modulemap [llvm/Orc] Fix ExecutionEngine module build breakage 2021-01-19 14:39:06 +01:00
module.modulemap.build
Pass.h [NFC] Rename ThinLTOPhase to ThinOrFullLTOPhase and move it from PassBuilder.h 2021-01-13 15:55:40 -08:00
PassAnalysisSupport.h [PM] Avoid duplicates in the Used/Preserved/Required sets 2021-01-20 13:55:18 +01:00
PassInfo.h
PassRegistry.h
PassSupport.h