• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to Inspect Method/Function Args Under GCC 4.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to Inspect Method/Function Args Under GCC 4.2 (From: Keary Suska <email@hidden>)
 >Re: How to Inspect Method/Function Args Under GCC 4.2 (From: Ken Thomases <email@hidden>)
 >Re: How to Inspect Method/Function Args Under GCC 4.2 (From: Keary Suska <email@hidden>)
 >Re: How to Inspect Method/Function Args Under GCC 4.2 (From: Gideon King <email@hidden>)
 >Re: How to Inspect Method/Function Args Under GCC 4.2 (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: How to Inspect Method/Function Args Under GCC 4.2
  • Next by Date: Re: Why can't I Run > Fix?
  • Previous by thread: Re: How to Inspect Method/Function Args Under GCC 4.2
  • Next by thread: How do I set a custom path to svn?
  • Index(es):
    • Date
    • Thread