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


Date: Mon, 21 Apr 2014 09:59:44 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] How to use DyninstAPI to get thread/process call stack in case of a signal delivery
On 04/20/2014 09:02 AM, JiangJie wrote:
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

Jie--

I'm assuming that you just want a debugging call stack, and aren't aiming for any sort of recovery.

If you set DYNINST_DEBUG_CRASH in your environment, that should produce a stack trace and register contents. You can set that variable to the location of your preferred gdb, which will attempt to attach gdb to the mutatee, or set it to "sleep", which will leave the mutator spinning in a sleep loop. Any other value should produce a core file (if your environment is set up to allow them).

Hope that helps.

--bw


 > 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


_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api



--
--bw

Bill Williams
Paradyn Project
bill@xxxxxxxxxxx
[← Prev in Thread] Current Thread [Next in Thread→]