diff options
author | Pedro Alves <palves@redhat.com> | 2013-09-02 14:14:58 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-09-02 14:14:58 +0000 |
commit | 9a13b2fa01990ef21856bba455fdd39d5d81eb5f (patch) | |
tree | 4db63317ad70c14eb89f02a8470f3111f678a820 /gdb/gdbserver | |
parent | 7126d5c82e6582701b875ad0133423dbd02d62b0 (diff) | |
download | gdb-9a13b2fa01990ef21856bba455fdd39d5d81eb5f.zip gdb-9a13b2fa01990ef21856bba455fdd39d5d81eb5f.tar.gz gdb-9a13b2fa01990ef21856bba455fdd39d5d81eb5f.tar.bz2 |
server.c:gdb_read_memory: Fix error return.
When I added gdb_read_memory, with bits factored out from elsewhere, I
missed adjusting this error return. gdb_read_memory has an interface
similar to Like GDB's xfer_partial:
> /* Read trace frame or inferior memory. Returns the number of bytes
> actually read, zero when no further transfer is possible, and -1 on
> error. Return of a positive value smaller than LEN does not
> indicate there's no more to be read, only the end of the transfer.
Returning EIO, a positive value, is obviously bogus, for the caller
will confuse it with a successful partial transfer.
Found by inspection.
Tested on x86_64 Fedora 17.
gdb/gdbserver/
2013-09-02 Pedro Alves <palves@redhat.com>
* server.c (gdb_read_memory): Return -1 on traceframe memory read
error instead of EIO.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/server.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 913fe42..1e15f77 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2013-09-02 Pedro Alves <palves@redhat.com> + + * server.c (gdb_read_memory): Return -1 on traceframe memory read + error instead of EIO. + 2013-08-28 Jan Kratochvil <jan.kratochvil@redhat.com> PR server/15604 diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index ebdaba5..d450779 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -716,7 +716,7 @@ gdb_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) if (traceframe_read_mem (current_traceframe, memaddr, myaddr, len, &nbytes)) - return EIO; + return -1; /* Data read from trace buffer, we're done. */ if (nbytes > 0) return nbytes; |