Re: How to Inspect Method/Function Args Under GCC 4.2
Re: How to Inspect Method/Function Args Under GCC 4.2
- Subject: Re: How to Inspect Method/Function Args Under GCC 4.2
- From: Clark Cox <email@hidden>
- Date: Mon, 15 Mar 2010 22:45:42 -0700
On Mon, Mar 15, 2010 at 6:33 PM, Keary Suska
<email@hidden> wrote:
> On Mar 15, 2010, at 5:48 PM, Gideon King wrote:
>
>> So what's the equivalent for a 64 bit app?
>
> The following is a quote from an email by Clark Cox. Apparently, 64 bit uses a certain set of registers. Easier to remember, for sure.
>
> $rdi -> arg0 (self)
> $rsi -> arg1 (_cmd)
> $rdx -> arg2
> $rcx -> arg3
> $r8 -> arg4
> $r9 -> arg5
>
Indeed. For pointers and integers, all of the parameters under x86_64
are passed directly in registers (like they are on ppc and ppc64), so
there is no need to go to the stack to inspect them.
So, where you would have used "po *(id*)($ebp + 8)" on i386, you would
use "po $rdi" on x86_64.
http://www.clarkcox.com/blog/2009/02/04/inspecting-obj-c-parameters-in-gdb/
--
Clark S. Cox III
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