This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: why I dislike qXfer
- From: Pedro Alves <palves at redhat dot com>
- To: David Taylor <dtaylor at emc dot com>, gdb at sourceware dot org
- Date: Mon, 13 Jun 2016 19:35:37 +0100
- Subject: Re: why I dislike qXfer
- Authentication-results: sourceware.org; auth=none
- References: <31527 dot 1465841753 at usendtaylorx2l>
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