WCU / Cybersecurity
~/CSC 471/Class 03/KP 17
Class 03 · KP 17 / 21

Reading the Frame Live in GDB

Break at a function and inspect its frame:

gdb ./target
(gdb) break add_squares      # stop at the function
(gdb) run
(gdb) info frame             # frame base, saved regs, return addr
(gdb) bt                     # backtrace: the frame chain
(gdb) info args              # incoming arguments
(gdb) info locals            # local variables
  • info frame shows saved RIP (return addr) and saved RBP.
  • bt walks the whole call chain, frame by frame.