This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH]: Set nr_bytes in remote_write_bytes
- To: Andrew Cagney <ac131313 at cygnus dot com>, gdb-patches at sources dot redhat dot com
- Subject: Re: [PATCH]: Set nr_bytes in remote_write_bytes
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 14 May 2001 14:29:34 -0700
- Organization: Red Hat
- References: <3B002606.5B737A04@cygnus.com> <3B003E94.5020306@cygnus.com>
Andrew Cagney wrote:
>
> 2001-05-14 Michael Snyder <msnyder@redhat.com>
>
> * remote.c (remote_write_bytes): Set nr_bytes to return value of
> bin2hex.
>
> as far as I can tell the code:
>
> > ! bin2hex (myaddr, p, todo);
> > ! nr_bytes = todo;
> > break;
>
> is identical to:
>
> > ! nr_bytes = bin2hex (myaddr, p, todo);
It is identical, assuming that you know the implementation details of bin2hex.
I think it's cleaner to not assume this. Pragmatically it makes no difference,
but this is write_bytes, which implements xfer_memory. In principal it could
return a number smaller than the requested number. I was just coding to that
model.