Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: David Taylor <dtaylor@emc.com>
To: gdb@sourceware.org
Cc: dtaylor@emc.com
Subject: why I dislike qXfer
Date: Mon, 13 Jun 2016 18:16:00 -0000	[thread overview]
Message-ID: <31527.1465841753@usendtaylorx2l> (raw)

There are a number of remote protocol packets of the form

    qXfer:object:read:annex:offset,length

For some object or object/annex combinations, this is a reasonable
interface -- for example, when it is referring to data that does not
change (and often it will reasonably fit within a single remote protocol
reply packet).

An example would be qXfer:features.  My expectation is that if we
implement this that it will be compiled in strings.  Unless you connect
to a different target or load new code on the target, it is not going to
change.

A board has a set of features and it doesn't typically change.

But, there are some objects for which it is, in my opinion, a poor
interface.

For concreteness, consider the 'threads' object -- as it is the one I'm
currently wrestling with.

Threads come and go.  And the amount of information I want to return per
currently existing thread means that number of threads * bytes of info
per thread exceeds the maximum packet size.  So, multiple requests have
to be issued to get everything.

The system native format for the information is, of course, not XML.
The per-thread data is variable length (e.g., the name field and, in our
case, the 'extra information').  I want to always return the most
current information.  I want to return information on as many threads as
possible.  And I want to minimize the bookkeeping required.

So, while I can avoid having to store the current position, if I am
going to minimize bookkeeping and return the latest information, I have
to pad each entry to the same size and cannot skip empty (read: dead
thread) entries in the system process table.  If the goal is to speed
things up by, in part, having fewer network round trips, having to pad
is not a win.

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.

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?


             reply	other threads:[~2016-06-13 18:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 18:16 David Taylor [this message]
2016-06-13 18:35 ` Pedro Alves
2016-06-16 17:42   ` taylor, david
2016-06-16 18:25     ` Pedro Alves
2016-06-16 20:00       ` taylor, david
2016-06-17 14:33         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31527.1465841753@usendtaylorx2l \
    --to=dtaylor@emc.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox