gdb macros xp and xxp
nkoch at demig.de
Thu Apr 5 09:03:00 UTC 2007
for learning about gdb macros
I looked through gdbinit-1.i386.
( or is there some secret gdb manual
that *explains* macros? :-)
The macros xp and xxp calculate
the number of possible arguments as:
Let's see (assuming "char* ebp"):
*ebp : saved ebp from previous frame
*(ebp+4) : saved eip
*(ebp+8): first parameter (if any)
*((*ebp)-4): saved register or local variable from previous frame
What I do not understand is the
subtraction of 4 (I expected 2).
When disassembling through different
portions of the kernel code and userland
programs, I found pushing of none up to
three extra register (ebx, esi, ebp).
But that depends heavyly on compiler options,
So, is it just a guess that there are two register
variables or am I missing something?
More information about the freebsd-hackers