Dumping Raw Stack Memory
(gdb) x/16xg $rsp # 16 giant (8-byte) words in hex from top
(gdb) x/8xg $rbp # inspect around the frame base
(gdb) p/x $rsp # print RSP value
(gdb) p/x $rbp # print RBP value
(gdb) break *add_squares+4 # break just after the prologue
x/16xg $rsp— examine 16 giant words in hex.- Set a breakpoint at the prologue, single-step
push rbpandmov rbp, rsp, and watchRSP/RBPmove. - Compare
x/16xg $rspbefore and after acallto see the return address appear.