[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-dtrace-discuss
Subject:    Re: [dtrace-discuss] Probes for C++ methods
From:       James McIlree <jmcilree () apple ! com>
Date:       2008-03-26 21:49:26
Message-ID: 85215AE4-2F5A-4143-A4F8-38554CBF331F () apple ! com
[Download RAW message or body]


On Mar 26, 2008, at 1:59 PM, Sudheer wrote:
>
>> argX is "mostly" the same as args[X]. The difference
>> e is that argX is
>> the raw
>> ABI, not a typed argument. So you'll run into things
>> like "On this
>> arch, a 64 bit value
>> is passed in two argument slots." If you don't get
>> the answers you
>> expect, you're probably
>> going to need to dig into the ABI to figure out where
>> the data you
>> want is stored.
>>
>> Just in case, here is the document you should hope
>> e you don't have to
>> read :-)
>>
>> 	http://developer.apple.com/documentation/DeveloperToo
>> ls/Conceptual/LowLevelABI/Introduction.html
>>
>> 	James M
>
> Is there no easier way? :-(
> As the third argument is a const reference to an object, how can I  
> use arg2 to get what I wanted?
>
> Can I do tracemem ( copyin (arg2, 32), 32)?

	Unfortunately, there isn't an easier way for pid arguments (yet).

	Without knowing the exact details of what you are trying to do, I  
can't say for certain
which arg register to use. A simple first try on 32 bit x86 is one arg  
for the "this" pointer,
and then just count arguments. If anything is 64 bit, it will take two  
argument slots. Anything
fancy and you'll have to take a look at the ABI document to see how it  
is passed.

	James M

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic