Functions in Frame Pointers and Local Variables
Explore how function prologues set up stack frames by saving registers and allocating space for local variables, while epilogues restore registers before returning. Understand the raw stack layout and disassembly for ARM64 functions, and practice using GDB commands to inspect registers and analyze local variables in debugging scenarios.
We'll cover the following...
Function prolog
The sequence of instructions resulting in the initialization of the sp register, saving x29 and x30(lr), if there are further calls inside, and making room for local variables is called function prolog. One example of this is shown in the slides below, where func calls func2, which has one local variable, var. Sometimes saving necessary registers is also considered a part of a function prolog.
Recall the codes of ...