This is the mail archive of the gdb-patches@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: [RFC] Make target_read_string faster over high-latency links.


On Mon, Jul 18, 2011 at 10:09 AM, Tom Tromey <tromey@redhat.com> wrote:

> Paul> 2. Current target_read_string aligns reads on a 4-byte boundary. Code
> Paul> ? ?could be simplified quite a bit if it didn't do that.
> Paul> ? ?Are there targets where such alignment is required?
>
> I don't know this either, sorry.

In gdb.texinfo, Node Packets:

  @item m @var{addr},@var{length}
  @cindex @samp{m} packet
  Read @var{length} bytes of memory starting at address @var{addr}.
  Note that @var{addr} may not be aligned to any particular boundary.

I *think* this suggests that alignment is not really necessary here.

> What about making it possible for gdbserver to do the string-reading
> itself, with a fallback to the existing code for older versions? ?Then
> you don't need a parameter or any tuning.

Just to clarify, you are suggesting a new packet, e.g.
  qStr {addr},{maxlen}
in response to which gdbserver will read up to either terminating NUL,
or maxlen.

That sounds like a good idea, except I would also add {terminator} byte, so
you could read "memory from addr to {terminator} but no more than {maxlen}".

Terminator could be optional.

Don't know if it's really necessary, but it could come in handy if you
want to read up to '\n' or some such.

Thanks,
-- 
Paul Pluzhnikov


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