sframe: Fix RA and FP stack recovery comments
A patch corrects comments in the `sframe.h` header file to accurately reflect how Return Address (RA) and Frame Pointer (FP) stack recovery values are interpre…
This patch corrects comments in include/sframe.h to accurately describe the stack recovery mechanism for Return Address (RA) and Frame Pointer (FP) registers. Previously, comments indicated that stack recovery involved adding an offset to the Call Frame Address (CFA) or a base register. The corrected comments now clarify that these offsets are used to dereference a memory location, signifying that the actual RA and FP values are stored at *(CFA + offset) or *(BASE_REG + offset) respectively, rather than being directly calculated by adding the offset.
- proposer
Submitted a patch to fix comments in `sframe.h` related to RA and FP stack recovery, changing the interpretation from addition to dereferencing.
“Fix the interpreted typo and change CFA + offset to *(CFA + offset) for RA and FP stack recovery.”
In Details
This is a documentation-only patch for the sframe (stack frame unwind information) component within Binutils. It corrects comments in sframe.h to accurately reflect how Frame Pointer (FP) and Return Address (RA) values are recovered from the stack. The change clarifies that offsets are used as memory addresses to dereference, rather than being directly added to the CFA (Call Frame Address) or a base register to obtain the FP/RA values.
- sframe
- Stack Frame unwind information. This data structure and associated logic in Binutils helps in unwinding the call stack, typically used for debugging and profiling.
- RA
- Return Address. The address in the calling function to which the program should return after the current function completes.
- FP
- Frame Pointer. A register that points to the beginning of a stack frame, used to access local variables and parameters within a function.
- CFA
- Call Frame Address. The canonical address of the stack frame. It's used as a reference point for calculating the locations of other values within the stack frame, such as saved registers.
- stack recovery
- The process of retrieving saved register values (like RA and FP) from the stack during stack unwinding to reconstruct the state of previous stack frames.