This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH]: Set nr_bytes in remote_write_bytes


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.


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