diff options
author | Pedro Alves <palves@redhat.com> | 2011-01-25 10:09:19 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-01-25 10:09:19 +0000 |
commit | d08aafeffe7dcdff4c4f876c6b8f730ce0270847 (patch) | |
tree | 6d1be3ef6bfa5408fcf5c8e7ac8344c04869328e /gdb/gdbserver/remote-utils.c | |
parent | efc0eabd6019406ff92286a36713d41a42515e09 (diff) | |
download | gdb-d08aafeffe7dcdff4c4f876c6b8f730ce0270847.zip gdb-d08aafeffe7dcdff4c4f876c6b8f730ce0270847.tar.gz gdb-d08aafeffe7dcdff4c4f876c6b8f730ce0270847.tar.bz2 |
2011-01-25 Pedro Alves <pedro@codesourcery.com>
* server.h (decode_xfer_write): Change prototype.
* remote-utils.c (decode_xfer_write): Remove `annex' parameter,
and don't extract the annex here.
* server.c (decode_xfer_read): Remove `annex' parameter,
and don't extract the annex here.
(decode_xfer): New.
(struct qxfer): New.
(handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
(handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
(handle_qxfer_statictrace): New functions, abstracted out from
handle_query, and made to use the struct qxfer interface.
(handle_threads_qxfer_proper): Rename to ...
(handle_qxfer_threads_proper): ... this.
(handle_threads_qxfer): Rename to ...
(handle_qxfer_threads): ... this. Adjust.
(qxfer_packets): New array.
(handle_qxfer): New function.
(handle_query): Use handle_qxfer.
Diffstat (limited to 'gdb/gdbserver/remote-utils.c')
-rw-r--r-- | gdb/gdbserver/remote-utils.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 69f102b..88ef347 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -1432,19 +1432,13 @@ decode_X_packet (char *from, int packet_len, CORE_ADDR *mem_addr_ptr, } /* Decode a qXfer write request. */ + int -decode_xfer_write (char *buf, int packet_len, char **annex, CORE_ADDR *offset, +decode_xfer_write (char *buf, int packet_len, CORE_ADDR *offset, unsigned int *len, unsigned char *data) { char ch; - - /* Extract and NUL-terminate the annex. */ - *annex = buf; - while (*buf && *buf != ':') - buf++; - if (*buf == '\0') - return -1; - *buf++ = 0; + char *b = buf; /* Extract the offset. */ *offset = 0; @@ -1455,7 +1449,7 @@ decode_xfer_write (char *buf, int packet_len, char **annex, CORE_ADDR *offset, } /* Get encoded data. */ - packet_len -= buf - *annex; + packet_len -= buf - b; *len = remote_unescape_input ((const gdb_byte *) buf, packet_len, data, packet_len); return 0; |