This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why I dislike qXfer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]