aboutsummaryrefslogtreecommitdiff
path: root/gdb
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
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')
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/server.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index e623ae7..3a53f86 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-06 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * server.c (handle_query): Correct error handling for read_auxv.
+
2005-10-19 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
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);