Re: [DynInst_API:] oneTimeCode() and exit callbacks


Date: Mon, 25 Feb 2013 15:34:44 -0600
From: David Smith <dsmith@xxxxxxxxxx>
Subject: Re: [DynInst_API:] oneTimeCode() and exit callbacks
On 02/25/2013 03:00 PM, Andrew Bernat wrote:
> On Feb 25, 2013, at 1:17 PM, David Smith <dsmith@xxxxxxxxxx
> <mailto:dsmith@xxxxxxxxxx>> wrote:
> 
>> This works great for thread creation probes (for instance), but not for
>> exit probes. When the exit callback happens, I call stopExecution().
>> However, when stopExecution() returns, the process has already
>> terminated, so I can't call oneTimeCode().
> 
> Is there any way you can call the oneTimeCode directly from the
> callback? The thread should still be present, if wrapping itself up,
> when the callback is delivered. There is an inherent race condition if
> something else is continuing the entire process but it doesn't sound
> like that's happening here. 

I'd like to call oneTimeCode() from the callback. However, oneTimeCode()
refuses to run if (!proc->isStopped()). As I mentioned earlier, if I
call stopExecution(), then the process exits. When stopExecution
returns, proc->isTerminated() is true (when I'm in the exit callback).

If I've misunderstood your answer, please let me know.

-- 
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
[← Prev in Thread] Current Thread [Next in Thread→]