Re: debugging on Intel macs
Re: debugging on Intel macs
- Subject: Re: debugging on Intel macs
- From: Aurélien Hugelé <email@hidden>
- Date: Wed, 15 Feb 2006 13:24:05 +0100
Thanks for your explanations. As i feared, it is way above me... I'll
keep a powermac around for several years just to debug someone-else's
code :)
Damn x86
long live to PPC !
On 15 févr. 06, at 10:29, Jonas Maebe wrote:
On 15 feb 2006, at 10:17, Aurélien Hugelé wrote:
Can someone confirm my fears ? will I be able to print "self" in
$r3, the current selector in $r4 and arguments in $r5 -> rX ? or
things will be different ?
Just print the parameters/variables by name, gdb will fetch them
from the correct location. Also note that printing the contents
of those registers on PPC will give you wrong results in many
instances, because the parameters are only guaranteed to be in
those registers at the start of the routine. They can be located
anywhere (including in memory) inside the body of the routine.
i forgot to add that i use GDB for something other than my code...
so i do not know the names of parameters and variables....
i often add a (future)breakpoints to cocoa's method and look at
their arguments etc... to know how to use it...
First of all, your idea that all PPC arguments are passed in r3->rX
is wrong. It's r3->r10, and the rest is also passed on the stack on
PPC. Of course, it doesn't happen that often that your run out of
registers.
Apple's x86 abi is documented at http://developer.apple.com/
documentation/DeveloperTools/Conceptual/LowLevelABI/Articles/
IA32.html#//apple_ref/doc/uid/TP40002492-SW4
They do not use registers to pass parameters in any case. If a
function has a frame pointer and already set up its stack frame,
you can view the first parameter using "x/x $ebp+8", the second
using "x/x $ebp+12" etc. If the frame pointer is optimized away,
you'll have to disassemble the code to see by how much the stack
pointer (esp) has already been changed and then look at the right
offset relative to esp (also using x/x). The parameters start at "x/
x $esp+4" (x/x $esp is the return address) as long as esp is not
yet modified.
Jonas _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gumitech.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden