Re: [patch 0/8] GDB/GDBserver talks with agents

Pedro Alves
2012-02-09T19:02:48Z

On 01/23/2012 12:43 PM, Yao Qi wrote:
> When I am working on the new agent library [1], I found that only
> gdbserver is able to interact with agent on static tracepoints only.
> There are two limitations here, 1) only gdbserver is able to talk with
> agent, 2) only static tracepoint operations can be performed by agent.

This was a result of some consideration. I thought of two main
options when I was first designing the IPA:

- have gdbserver peek/poke at the IPA memory directly. Requires
some way for gdbserver to know where to poke etc., but, this was it's
possible for the inferior to be completely (or virtually completely)
unaffected by the IPA.

- spawn a thread in the IPA, and use it as a communication gate
with gdbserver. The upside of this solution you can come up with
some protocol for the communication, which is simpler than caring about
ABIs and layouts of objects. The downsides are that spawning a
thread in the inferior makes non-threaded programs suddenly become
threaded; and, you need to come up with a way to run the IPA
communication thread a while behind gdb/gdbserver's back, so it can
process the commands.

The IPA only gained static tracepoints support later.

I had to pick one approach and move on, so I picked the first. Later on,
the only way to communicate with ust was by calling some of its functions,
which implies the second approach...

--
Pedro Alves