LLVM  14.0.0git
Public Member Functions | List of all members
llvm::dwarf::UnwindRow Class Reference

A class that represents a single row in the unwind table that is decoded by parsing the DWARF Call Frame Information opcodes. More...

#include "llvm/DebugInfo/DWARF/DWARFDebugFrame.h"

Public Member Functions

 UnwindRow ()
 
bool hasAddress () const
 Returns true if the address is valid in this object. More...
 
uint64_t getAddress () const
 Get the address for this row. More...
 
void setAddress (uint64_t Addr)
 Set the address for this UnwindRow. More...
 
void slideAddress (uint64_t Offset)
 Offset the address for this UnwindRow. More...
 
UnwindLocationgetCFAValue ()
 
const UnwindLocationgetCFAValue () const
 
RegisterLocationsgetRegisterLocations ()
 
const RegisterLocationsgetRegisterLocations () const
 
void dump (raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH, unsigned IndentLevel=0) const
 Dump the UnwindRow to the stream. More...
 

Detailed Description

A class that represents a single row in the unwind table that is decoded by parsing the DWARF Call Frame Information opcodes.

The row consists of an optional address, the rule to unwind the CFA and all rules to unwind any registers. If the address doesn't have a value, this row represents the initial instructions for a CIE. If the address has a value the UnwindRow represents a row in the UnwindTable for a FDE. The address is the first address for which the CFA location and register rules are valid within a function.

UnwindRow objects are created by parsing opcodes in the DWARF Call Frame Information and UnwindRow objects are lazily populated and pushed onto a stack in the UnwindTable when evaluating this state machine. Accessors are needed for the address, CFA value, and register locations as the opcodes encode a state machine that produces a sorted array of UnwindRow objects

See also
UnwindTable.

Definition at line 251 of file DWARFDebugFrame.h.

Constructor & Destructor Documentation

◆ UnwindRow()

llvm::dwarf::UnwindRow::UnwindRow ( )
inline

Definition at line 259 of file DWARFDebugFrame.h.

Member Function Documentation

◆ dump()

void UnwindRow::dump ( raw_ostream OS,
const MCRegisterInfo MRI,
bool  IsEH,
unsigned  IndentLevel = 0 
) const

Dump the UnwindRow to the stream.

Parameters
OSthe stream to use for output.
MRIregister information that helps emit register names insteead of raw register numbers.
IsEHtrue if the DWARF Call Frame Information is from .eh_frame instead of from .debug_frame. This is needed for register number conversion because some register numbers differ between the two sections for certain architectures like x86.
IndentLevelspecify the indent level as an integer. The UnwindRow will be output to the stream preceded by 2 * IndentLevel number of spaces.

Definition at line 172 of file DWARFDebugFrame.cpp.

References llvm::dwarf::UnwindLocation::dump(), llvm::dwarf::RegisterLocations::dump(), llvm::format(), hasAddress(), llvm::dwarf::RegisterLocations::hasLocations(), llvm::raw_ostream::indent(), and MRI.

◆ getAddress()

uint64_t llvm::dwarf::UnwindRow::getAddress ( ) const
inline

Get the address for this row.

Clients should only call this function after verifying it has a valid address with a call to

See also
hasAddress().

Definition at line 268 of file DWARFDebugFrame.h.

References llvm::Address.

◆ getCFAValue() [1/2]

UnwindLocation& llvm::dwarf::UnwindRow::getCFAValue ( )
inline

Definition at line 283 of file DWARFDebugFrame.h.

◆ getCFAValue() [2/2]

const UnwindLocation& llvm::dwarf::UnwindRow::getCFAValue ( ) const
inline

Definition at line 284 of file DWARFDebugFrame.h.

◆ getRegisterLocations() [1/2]

RegisterLocations& llvm::dwarf::UnwindRow::getRegisterLocations ( )
inline

Definition at line 285 of file DWARFDebugFrame.h.

◆ getRegisterLocations() [2/2]

const RegisterLocations& llvm::dwarf::UnwindRow::getRegisterLocations ( ) const
inline

Definition at line 286 of file DWARFDebugFrame.h.

◆ hasAddress()

bool llvm::dwarf::UnwindRow::hasAddress ( ) const
inline

Returns true if the address is valid in this object.

Definition at line 262 of file DWARFDebugFrame.h.

References llvm::Address.

Referenced by dump().

◆ setAddress()

void llvm::dwarf::UnwindRow::setAddress ( uint64_t  Addr)
inline

Set the address for this UnwindRow.

The address represents the first address for which the CFAValue and RegLocs are valid within a function.

Definition at line 274 of file DWARFDebugFrame.h.

References Addr, and llvm::Address.

◆ slideAddress()

void llvm::dwarf::UnwindRow::slideAddress ( uint64_t  Offset)
inline

Offset the address for this UnwindRow.

The address represents the first address for which the CFAValue and RegLocs are valid within a function. Clients must ensure that this object already has an address (

See also
hasAddress()) prior to calling this function.

Definition at line 282 of file DWARFDebugFrame.h.

References llvm::Address, and Offset.


The documentation for this class was generated from the following files: