Anatomy of a Stack Frame
A stack frame is the slice of stack owned by one function call.
- Return address — pushed by the caller's
call. - Saved RBP — the caller's frame pointer, saved in the prologue.
- Saved registers — callee-saved registers the function will clobber.
- Local variables — addressed relative to
RBPorRSP. - Outgoing arguments — extra args for functions this one calls.
Key Takeaway
One frame per active call. RBP anchors the current frame; RSP marks its edge.