(gdb) info frame
stack level 0
- Frame number in backtrace. 0 is the current executing frame, which grows downwards, in consistence with the stack.
frame at 0xb75f7390
- Starting memory address of this stack frame.
eip = 0x804877f in base::func() (testing.cpp:16); saved eip 0x804869a
-
eip is the register for the next instruction to execute (also called program counter). So at this moment, the next instruction to execute is at “0x804877f”, which is line 16 of
testing.cpp. -
saved eip “0x804869a” is the so called “return address”, i.e., the instruction to resume in the caller stack frame after returning from this callee stack. It is pushed onto the stack upon the “CALL” instruction (save it for return).
called by frame at 0xb75f73b0
- The address of the caller stack frame.
source language c++
- Which language is in use.
Arglist at 0xb75f7388, args: this=0x0
- The starting address of arguments.
Locals at 0xb75f7388,
- Address of local variables.
Previous frame’s sp is 0xb75f7390
- This is where the previous frame’s stack pointer points to (the caller frame), at the moment of calling. It is also the starting memory address of the called stack frame.
Saved registers
- These are the two addresses on the callee stack, for two saved registers.
ebp at 0xb75f7388
- That is the address where the “ebp” register of the caller’s stack frame is saved (please note, it is the register, not the caller’s stack address), i.e., corresponding to “PUSH %ebp”. “ebp” is the register usually considered as the starting address of the locals of this stack frame, which use “offset” to address.
In other words, the operations of local variables all use this “ebp”, so you will see something likemov -0x4(%ebp), %eax, etc.
eip at 0xb75f738c
- As mentioned before, but here it is the address of the stack (which contains the value “0x804877f”).