Skip to main content

IAR Embedded Workbench for RL78 5.20

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.

This table lists all the resources defined in the names block used by the compiler:

Resource

Description

CFA

The call frames of the regular stack and of the interrupt stack, respectively

A, B, C, D, E, H, L, X

Normal registers

CS_REG

Bit 16–19 in the code address space

ES_REG

Bit 16–19 in the data address space

MACRH

The high 16 bits of the MAC register

MACRL

The low 16 bits of the MAC register

SP

The stack pointer register

?SPH

The upper four bits of ?SP20 (always 0xF)

?RET

For return addresses (a 20-bit address)

W0–W127

The wrkseg area

Table 67. Call frame information resources defined in a names block