How to interpret GDB "info frame" output? -


can please me understand this:-

(gdb) info frame stack level 0, frame @ 0xb75f7390:  eip = 0x804877f in base::func() (testing.cpp:16); saved eip 0x804869a  called frame @ 0xb75f73b0  source language c++.  arglist @ 0xb75f7388, args: this=0x0  locals @ 0xb75f7388, previous frame's sp 0xb75f7390  saved registers:   ebp @ 0xb75f7388, eip @ 0xb75f738c 

what "ebp, eip locals @ , previous frame's sp " means? please explain

(gdb) info frame

stack level 0

  • frame num in backtrace, 0 current executing frame, grows downwards, in consistence stack.

frame @ 0xb75f7390

  • starting memory address of stack frame

eip = 0x804877f in base::func() (testing.cpp:16); saved eip 0x804869a

  • eip register next instruction execute (also called program counter). @ moment, next execute @ "0x804877f", line 16 of testing.cpp.

  • saved eip "0x804869a" called "return address", i.e., instruction resume in caller stack frame after returning callee stack. pushed stack upon "call" instruction (save return).

called frame @ 0xb75f73b0

  • the address of caller stack frame

source language c++

  • which language in use

arglist @ 0xb75f7388, args: this=0x0

  • the starting address of arguments

locals @ 0xb75f7388,

address of local variables.

previous frame's sp 0xb75f7390

this previous frame´s stack pointer point (the caller frame), @ moment of calling, starting memory address of called stack frame.

saved registers: these 2 addresses on callee stack, 2 saved registers.

  • ebp @ 0xb75f7388 address "ebp" register of caller´s stack frame saved (please note, register, not caller´s stack address). i.e., corresponding "push %ebp". "ebp" register considered starting address of locals of stack frame, use "offset" address. in word, operations of local variables use "ebp", see mov -0x4(%ebp), %eax, etc.

  • eip @ 0xb75f738c mentioned before, here address of stack (which contains value "0x804877f").


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -