aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-03-05 03:43:19 +0000
committerDaniel Jacobowitz <drow@false.org>2004-03-05 03:43:19 +0000
commitc3e735a6a3d7b849b44f102a0c3e2722d49666b7 (patch)
tree624482b0563448cde74e4eb0b15a82dcfd18d4ba /gdb/gdbserver/server.c
parentd81510055c95d786c5ce789b1e96f9919f91b05a (diff)
downloadgdb-c3e735a6a3d7b849b44f102a0c3e2722d49666b7.zip
gdb-c3e735a6a3d7b849b44f102a0c3e2722d49666b7.tar.gz
gdb-c3e735a6a3d7b849b44f102a0c3e2722d49666b7.tar.bz2
* linux-low.c (linux_read_memory): Change return type to
int. Check for and return error from ptrace(). * target.c (read_inferior_memory): Change return type to int. Pass back return status from the_target->read_memory(). * target.h (struct target_ops): Adapt *read_memory() prototype. Update comment. (read_inferior_memory): Adapt prototype. * server.c (main): Return an error packet if read_inferior_memory() returns an error.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index fb667ef..cc8923e 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -462,8 +462,10 @@ main (int argc, char *argv[])
break;
case 'm':
decode_m_packet (&own_buf[1], &mem_addr, &len);
- read_inferior_memory (mem_addr, mem_buf, len);
- convert_int_to_ascii (mem_buf, own_buf, len);
+ if (read_inferior_memory (mem_addr, mem_buf, len) == 0)
+ convert_int_to_ascii (mem_buf, own_buf, len);
+ else
+ write_enn (own_buf);
break;
case 'M':
decode_M_packet (&own_buf[1], &mem_addr, &len, mem_buf);