Skip to main content

IAR Embedded Workbench for Arm 9.70.x

CFI directives

In this section:

The CFI directives provide C-SPY with information about the state of the calling function(s). Most important of this is the return address, and the value of the stack pointer at the entry of the function or assembler routine. Given this information, C-SPY can reconstruct the state for the calling function, and thereby unwind the stack.

A full description about the calling convention might require extensive call frame information. In many cases, a more limited approach will suffice.

When describing the call frame information, the following three components must be present:

  • A names block describing the available resources to be tracked

  • A common block corresponding to the calling convention

  • A data block describing the changes that are performed on the call frame. This typically includes information about when the stack pointer is changed, and when permanent registers are stored or restored on the stack.

32-bit mode call frame information resources:

Resource

Description

CFA R13

The call frames of the stack

R0–R12

Processor general-purpose 32-bit registers

R13

Stack pointer, SP

R14

Link register, LR

D0-D31

Vector Floating Point (VFP) 64-bit coprocessor register

CPSR

Current program status register

SPSR

Saved program status register

Table 85. 32-bit mode call frame information resources defined in a names block 


64-bit mode call frame information resources:

Resource

Description

X0–X29

Processor general-purpose 64-bit registers

X30

Link register, LR

SP

Stack pointer

CFA SP

The call frames of the stack

ELR_mode

Exception level

V0-V31

Vector Floating Point (VFP) 64-bit registers (in reality, they are 128 bits, but the ABI cannot handle this)

Table 86. 64-bit mode call frame information resources defined in a names block