Re: why I dislike qXfer

Pedro Alves <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 06/13/2016 07:15 PM, David Taylor wrote:

> With the qT{f,s}{STM,P,V} q{f,s}ThreadInfo (and possibly others)
> interfaces, nothing needs to be precomputed, and I either start at the
> beginning (f -- first) or where the previous request left off (s --
> subsequent).

> I have to store, per connection, my location.  But, there is no random
> reading.  The next request of that flavor will either start at the
> beginning (f) or where the last one left off (s).  Reads are sequential.

If you support non-stop mode, the target is running and list of threads
changes as gdb is iterating.  The "location" thread can exit and you're
left not knowing where to continue from, for example.  To get around that,
generate a stable snapshot when you get the f requests, and serve gdb
requests from that snapshot.

> With the offset,length interface I don't know that reads will be
> sequential so I need to pad and leave gaps.
> 

> What do people do?

Generate a snapshot when gdb requests offset 0.  Then serve requests
from that snapshot.

See handle_qxfer_threads in gdbserver's sources.

Thanks,
Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.