I know how to use gdb and used info frame but I can't find the value of the base, stack and saved base pointer. How do I get these? Can I find them in the information info frame gives me or do I have to do something else?
info reg will tell you the contents of the registers, including the stack pointer (rsp on 64 bit x86) and base pointer (rbp on 64 bit x86):
(gdb) info reg
rax 0x401340 4199232
rbx 0x0 0
rcx 0x0 0
rdx 0x7fffffffe608 140737488348680
rsi 0x7fffffffe5f8 140737488348664
rdi 0x0 0
rbp 0x0 0x0
rsp 0x7fffffffe508 0x7fffffffe508
r8 0x7ffff7dd4e80 140737351863936
r9 0x7ffff7dea560 140737351951712
r10 0x7fffffffe2d0 140737488347856
r11 0x7ffff7a50290 140737348174480
r12 0x4013e2 4199394
r13 0x7fffffffe5f0 140737488348656
r14 0x0 0
r15 0x0 0
rip 0x7ffff7a50290 0x7ffff7a50290 <__GI_exit>
eflags 0x202 [ IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
The remaining info is available via info frame:
(gdb) info frame
Stack level 0, frame at 0x7fffffffe510:
rip = 0x7ffff7a50290 in __GI_exit (exit.c:104); saved rip = 0x40134d
called by frame at 0x7fffffffe520
source language c.
Arglist at 0x7fffffffe500, args: status=0
Locals at 0x7fffffffe500, Previous frame's sp is 0x7fffffffe510
Saved registers:
rip at 0x7fffffffe508
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With