Hello,

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:
 ((*(int*)$ebp)-(int)$ebp)/4-4

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
Right?

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,
doesn't it?

So, is it just a guess that there are two register
variables or am I missing something?

Any comments?

Norbert
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to