Re: -finstrument-functions and program startup
Re: -finstrument-functions and program startup
- Subject: Re: -finstrument-functions and program startup
- From: Colin Wheeler <email@hidden>
- Date: Thu, 29 Jan 2009 16:08:55 -0600
Specify the methods you want to trace in the probefunc section. For example
if you want to trace what lead up to and happened after a specific method
you could do something like
BEGIN
{
self->traceme = 0;
}
pid$target::<interested_method>:entry
{
self->traceme = 1;
ustack();
}
pid$target:::entry,
pid$target:::return
/self->traceme = 1/
{
}
END
{
self->traceme = 0;
}
this should simply give you a stack trace of what lead up to that method and
show you the functions occurred after that, if you want you can do stuff
like probemod != "libxxx.dylib" etc for the predicate.
On Thu, Jan 29, 2009 at 3:37 PM, Shawn Erickson <email@hidden> wrote:
> On Thu, Jan 29, 2009 at 12:55 PM, Benjamin Stiglitz <email@hidden>
> wrote:
>
> > That's not correct—the pid provider instruments every user function call
> in
> > the target (well, every one that has an externally visible symbol).
>
> Ah must be lack of symbols preventing it from working in my tests. Was
> only ever getting system library entry points and internal methods.
>
> How is this instrumentation done? I guess the text segment is modified
> in RAM when the pid provider is attached to the process?
>
> -Shawn
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden