Re: [DynInst_API:] How to use DyninstAPI to get thread/process call stack in case of a signal delivery


Date: Sun, 20 Apr 2014 22:02:21 +0800
From: JiangJie <yangtzj@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] How to use DyninstAPI to get thread/process call stack in case of a signal delivery
Hi Ray,

Yes it's possible to use ProcControlAPI directly to just intercept signal.

But my purpose is to collect the thread/process's callstack  in case of a signal delivery,
in order to  know the context where the signal is raised.
So I would like to call some API like BPatch_thread::getCallStack()
in the registered event callback for ProcControl

My question is, if I use ProcControlAPI->Process::registerEventCallback(EventType::Signal, my_signal_cb)
to register a callback to intercept a signal,  how to get the callstack in the registered callback?
Is it possible to make use of BPatch_thread::getCallStack() in the registered signal callback?
Or is there any other solution?

Regards,
Jie


> From: rchen@xxxxxxxxxx
> Date: Thu, 17 Apr 2014 16:50:15 -0400
> Subject: Re: [DynInst_API:] How to use DyninstAPI to get thread/process call stack in case of a signal delivery
> To: yangtzj@xxxxxxxxxxx
> CC: dyninst-api@xxxxxxxxxxx
>
> On Thu, Apr 17, 2014 at 11:01 AM, JiangJie <yangtzj@xxxxxxxxxxx> wrote:
> >
> > So why does not dyninstAPI support registering a signal handler callback for
> > Linux platform?
> >
> I'm sorry. I wasn't aware, but this functionality was originally
> implemented to support a specific windows-only project and never got
> ported to our other OS's.
>
> > Is it possible to implement such callback mechanism for Linux?
> >
> What sort of functionality do you need in your parent process? If
> you're only looking to intercept signals, have you considered using
> ProcControlAPI directly?
>
> http://www.dyninst.org/sites/default/files/manuals/dyninst/ProcControlAPI.pdf
>
> - Ray
[← Prev in Thread] Current Thread [Next in Thread→]