Re: [DynInst_API:] Tracing from a thread?


Date: Fri, 05 Jun 2015 10:56:59 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Tracing from a thread?
On 06/04/2015 09:25 PM, Tony Zhang wrote:
Thanks for the insight. I’m playing around with the idea of a debugger that would “live” completely inside the program being debugged. The advantage is that this eliminates inter process communication overhead. Of course the caveat is that the debugger itself is vulnerable to data corruption.

To this end, I want to see if DynInst can be used/modified/hacked to instrument other threads in the same process.

You could probably mash something together that would work, but I suspect that the intra-process overhead would turn out even worse than the inter-process overhead in practice--you're not hitting the kernel as often, but I'd expect the scheduling and memory benefits of a separate instrumentation process to overwhelm that. (At least I would if you wanted full Dyninst capabilities in your debugger.)

Basically you'd be creating a new type of AddressSpace for the particular debugger thread/original thread arrangement you wanted. If this is still something you think is worth experimenting with, I can answer questions about the internals.

On Jun 2, 2015, at 4:06 PM, Bill Williams <bill@xxxxxxxxxxx> wrote:

On 06/02/2015 02:57 PM, Tony Zhang wrote:
Hello,

Is it possible to use DynInst from a different thread within a process?
For example, a program would create multiplepthreads, and one of them (a
master) then attempts to control the execution of all other threads in
the program.

This isn't directly supported (assuming I understand your question), and I know I haven't tested any of the ways that you could in theory try to force this to work. (Self-attach I don't *think* will work, and likewise attaching to the child LWPs individually seems like a bad idea. You could insert instrumentation either statically or dynamically that has the effect of controlling a bunch of worker threads from a master one, but I don't think that's what you're trying to do here.)

Can you share a bit of context on your problem? That may suggest actually-supported ways to achieve what you want.

Thanks
Tony


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



--
--bw

Bill Williams
Paradyn Project
bill@xxxxxxxxxxx




--
--bw

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