diff options
author | Pedro Alves <palves@redhat.com> | 2015-08-27 13:37:01 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-08-27 13:37:01 +0100 |
commit | ab29043019ae2aaebe686d15aa460780280b6f66 (patch) | |
tree | 7a4433affb8f9fdd1bc09bc9e56e00c6094f22d8 | |
parent | 14d88147787588b1473da05adf95980931fd3485 (diff) | |
download | binutils-gdb-ab29043019ae2aaebe686d15aa460780280b6f66.tar.gz |
gdbserver/proc-service.c: bogus return value conversion
Building in C++ mode shows:
int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
^
src/gdb/gdbserver/proc-service.c:93:64: error: invalid conversion from ‘int’ to ‘ps_err_e’ [-fpermissive]
return write_inferior_memory ((unsigned long) addr, buf, size);
^
It only works today by accident, write_inferior_memory does not return
a ps_err_e.
gdb/gdbserver/ChangeLog:
2015-08-27 Pedro Alves <palves@redhat.com>
* proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbserver/proc-service.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 5b9b1705912..0be303076ef 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2015-08-27 Pedro Alves <palves@redhat.com> + + * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily. + 2015-08-26 Simon Marchi <simon.marchi@ericsson.com> * ax.c (gdb_parse_agent_expr): Likewise. diff --git a/gdb/gdbserver/proc-service.c b/gdb/gdbserver/proc-service.c index f36e3fb600d..128939dc2f4 100644 --- a/gdb/gdbserver/proc-service.c +++ b/gdb/gdbserver/proc-service.c @@ -90,7 +90,9 @@ ps_err_e ps_pdwrite (gdb_ps_prochandle_t ph, psaddr_t addr, gdb_ps_write_buf_t buf, gdb_ps_size_t size) { - return write_inferior_memory ((unsigned long) addr, buf, size); + if (write_inferior_memory ((unsigned long) addr, buf, size) != 0) + return PS_ERR; + return PS_OK; } /* Get the general registers of LWP LWPID within the target process PH |