LLVM 22.0.0git
|
A class that represents a location for the Call Frame Address (CFA) or a register. More...
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFUnwindTable.h"
Public Types | |
enum | Location { Unspecified , Undefined , Same , CFAPlusOffset , RegPlusOffset , DWARFExpr , Constant } |
Public Member Functions | |
Location | getLocation () const |
uint32_t | getRegister () const |
int32_t | getOffset () const |
bool | hasAddressSpace () const |
uint32_t | getAddressSpace () const |
int32_t | getConstant () const |
bool | getDereference () const |
void | setRegister (uint32_t NewRegNum) |
Some opcodes will modify the CFA location's register only, so we need to be able to modify the CFA register when evaluating DWARF Call Frame Information opcodes. | |
void | setOffset (int32_t NewOffset) |
Some opcodes will modify the CFA location's offset only, so we need to be able to modify the CFA offset when evaluating DWARF Call Frame Information opcodes. | |
void | setConstant (int32_t Value) |
Some opcodes modify a constant value and we need to be able to update the constant value (DW_CFA_GNU_window_save which is also known as. | |
std::optional< DWARFExpression > | getDWARFExpressionBytes () const |
LLVM_ABI bool | operator== (const UnwindLocation &RHS) const |
Static Public Member Functions | |
static LLVM_ABI UnwindLocation | createUnspecified () |
Create a location whose rule is set to Unspecified. | |
static LLVM_ABI UnwindLocation | createUndefined () |
Create a location where the value is undefined and not available. | |
static LLVM_ABI UnwindLocation | createSame () |
Create a location where the value is known to be in the register itself. | |
static LLVM_ABI UnwindLocation | createIsCFAPlusOffset (int32_t Off) |
Create a location that is in (Deref == false) or at (Deref == true) the CFA plus an offset. | |
static LLVM_ABI UnwindLocation | createAtCFAPlusOffset (int32_t Off) |
static LLVM_ABI UnwindLocation | createIsRegisterPlusOffset (uint32_t Reg, int32_t Off, std::optional< uint32_t > AddrSpace=std::nullopt) |
Create a location where the saved value is in (Deref == false) or at (Deref == true) a regiser plus an offset and, optionally, in the specified address space (used mostly for the CFA). | |
static LLVM_ABI UnwindLocation | createAtRegisterPlusOffset (uint32_t Reg, int32_t Off, std::optional< uint32_t > AddrSpace=std::nullopt) |
static LLVM_ABI UnwindLocation | createIsDWARFExpression (DWARFExpression Expr) |
Create a location whose value is the result of evaluating a DWARF expression. | |
static LLVM_ABI UnwindLocation | createAtDWARFExpression (DWARFExpression Expr) |
static LLVM_ABI UnwindLocation | createIsConstant (int32_t Value) |
A class that represents a location for the Call Frame Address (CFA) or a register.
This is decoded from the DWARF Call Frame Information instructions and put into an UnwindRow.
Definition at line 28 of file DWARFUnwindTable.h.
Enumerator | |
---|---|
Unspecified | Not specified. |
Undefined | Register is not available and can't be recovered. |
Same | Register value is in the register, nothing needs to be done to unwind it: reg = reg. |
CFAPlusOffset | Register is in or at the CFA plus an offset: reg = CFA + offset reg = defef(CFA + offset) |
RegPlusOffset | Register or CFA is in or at a register plus offset, optionally in an address space: reg = reg + offset [in addrspace] reg = deref(reg + offset [in addrspace]) |
DWARFExpr | Register or CFA value is in or at a value found by evaluating a DWARF expression: reg = eval(dwarf_expr) reg = deref(eval(dwarf_expr)) |
Constant | Value is a constant value contained in "Offset": reg = Offset. |
Definition at line 30 of file DWARFUnwindTable.h.
|
static |
Definition at line 35 of file DWARFUnwindTable.cpp.
References CFAPlusOffset, and llvm::dwarf::InvalidRegisterNumber.
Referenced by llvm::dwarf::parseRows().
|
static |
Definition at line 55 of file DWARFUnwindTable.cpp.
Referenced by llvm::dwarf::parseRows().
|
static |
Definition at line 46 of file DWARFUnwindTable.cpp.
References RegPlusOffset.
|
static |
Create a location that is in (Deref == false) or at (Deref == true) the CFA plus an offset.
Most registers that are spilled onto the stack use this rule. The rule for the register will use this rule and specify a unique offset from the CFA with Deref set to true. This value will be relative to a CFA value which is typically defined using the register plus offset location.
Definition at line 31 of file DWARFUnwindTable.cpp.
References CFAPlusOffset, and llvm::dwarf::InvalidRegisterNumber.
Referenced by llvm::dwarf::parseRows().
|
static |
Definition at line 27 of file DWARFUnwindTable.cpp.
References Constant, and llvm::dwarf::InvalidRegisterNumber.
Referenced by llvm::dwarf::parseRows().
|
static |
Create a location whose value is the result of evaluating a DWARF expression.
This allows complex expressions to be evaluated in order to unwind a register or CFA value.
Definition at line 51 of file DWARFUnwindTable.cpp.
Referenced by llvm::dwarf::parseRows().
|
static |
Create a location where the saved value is in (Deref == false) or at (Deref == true) a regiser plus an offset and, optionally, in the specified address space (used mostly for the CFA).
The CFA is usually defined using this rule by using the stack pointer or frame pointer as the register, with an offset that accounts for all spilled registers and all local variables in a function, and Deref == false.
Definition at line 40 of file DWARFUnwindTable.cpp.
References RegPlusOffset.
Referenced by llvm::dwarf::parseRows().
|
static |
Create a location where the value is known to be in the register itself.
Definition at line 25 of file DWARFUnwindTable.cpp.
References Same.
Referenced by llvm::dwarf::parseRows().
|
static |
Create a location where the value is undefined and not available.
This can happen when a register is volatile and can't be recovered.
Definition at line 23 of file DWARFUnwindTable.cpp.
References Undefined.
Referenced by llvm::dwarf::parseRows().
|
static |
Create a location whose rule is set to Unspecified.
This means the register value might be in the same register but it wasn't specified in the unwind opcodes.
Definition at line 21 of file DWARFUnwindTable.cpp.
References Unspecified.
|
inline |
Definition at line 131 of file DWARFUnwindTable.h.
References assert(), and RegPlusOffset.
Referenced by printUnwindLocation().
|
inline |
Definition at line 135 of file DWARFUnwindTable.h.
|
inline |
Definition at line 136 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
|
inline |
Definition at line 151 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
|
inline |
Definition at line 123 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
|
inline |
Definition at line 125 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
|
inline |
Definition at line 124 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
|
inline |
Definition at line 126 of file DWARFUnwindTable.h.
Referenced by printUnwindLocation().
bool UnwindLocation::operator== | ( | const UnwindLocation & | RHS | ) | const |
Definition at line 59 of file DWARFUnwindTable.cpp.
References CFAPlusOffset, Constant, DWARFExpr, RegPlusOffset, Same, Undefined, and Unspecified.
|
inline |
Some opcodes modify a constant value and we need to be able to update the constant value (DW_CFA_GNU_window_save which is also known as.
Definition at line 149 of file DWARFUnwindTable.h.
|
inline |
Some opcodes will modify the CFA location's offset only, so we need to be able to modify the CFA offset when evaluating DWARF Call Frame Information opcodes.
Definition at line 145 of file DWARFUnwindTable.h.
|
inline |
Some opcodes will modify the CFA location's register only, so we need to be able to modify the CFA register when evaluating DWARF Call Frame Information opcodes.
Definition at line 141 of file DWARFUnwindTable.h.