aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-11-06 21:50:32 +0000
committerDaniel Jacobowitz <drow@false.org>2006-11-06 21:50:32 +0000
commit000ef4f0ec1b3d35dc93e6f0cd2ab830693394cb (patch)
tree74b519584ebf7e2bde32dc256e17a0d2c22fe3f5 /gdb/gdbserver/server.c
parent821001857f53cf4278147326de50ad5bd838a6af (diff)
downloadgdb-000ef4f0ec1b3d35dc93e6f0cd2ab830693394cb.zip
gdb-000ef4f0ec1b3d35dc93e6f0cd2ab830693394cb.tar.gz
gdb-000ef4f0ec1b3d35dc93e6f0cd2ab830693394cb.tar.bz2
* server.c (handle_query): Correct error handling for read_auxv.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 86cb1b6..5f78736 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -232,7 +232,9 @@ handle_query (char *own_buf, int *new_packet_len_p)
len = PBUFSIZ - 2;
data = malloc (len + 1);
n = (*the_target->read_auxv) (ofs, data, len + 1);
- if (n > len)
+ if (n < 0)
+ write_enn (own_buf);
+ else if (n > len)
*new_packet_len_p = write_qxfer_response (own_buf, data, len, 1);
else
*new_packet_len_p = write_qxfer_response (own_buf, data, n, 0);