diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-10-31 15:25:34 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-10-31 15:25:34 +0000 |
commit | f4d2922d2ad172fb387f6fb39738eacc7242254c (patch) | |
tree | 1de212fad2eade47d9b2c91877b17f8b3413b4bd /gdb/remote.c | |
parent | 4bb95d7ff222052212bbaf68c23f6a3bb06c875b (diff) | |
download | gdb-f4d2922d2ad172fb387f6fb39738eacc7242254c.tar.gz |
2003-10-31 Andrew Cagney <cagney@redhat.com>
* target.h (struct target_ops): Replace "to_read_partial" and
"to_write_partial" with "to_xfer_partial". Update comments.
* target.c (debug_to_write_partial): Delete function.
(debug_to_xfer_partial): Replace debug_to_read_partial.
(add_target, update_current_target, setup_target_debug): Set
"to_xfer_partial" instead of "to_read_partial" and
"to_write_partial".
(default_xfer_partial): Replace "default_write_partial".
(default_read_partial): Delete.
(target_read_partial, target_write_partial): Call
"to_xfer_partial".
* remote.c (init_remote_ops): Set "to_xfer_partial".
(init_remote_async_ops): Ditto.
(remote_xfer_partial): Replace "remote_read_partial".
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 4b0ff1beb26..1e464dd0bce 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5102,8 +5102,8 @@ the loaded file\n"); } static LONGEST -remote_read_partial (struct target_ops *ops, enum target_object object, - const char *annex, void *buf, +remote_xfer_partial (struct target_ops *ops, enum target_object object, + const char *annex, const void *writebuf, void *readbuf, ULONGEST offset, LONGEST len) { struct remote_state *rs = get_remote_state (); @@ -5112,6 +5112,10 @@ remote_read_partial (struct target_ops *ops, enum target_object object, char *p2 = &buf2[0]; char query_type; + /* Only handle reads. */ + if (writebuf != NULL || readbuf == NULL) + return -1; + /* Map pre-existing objects onto letters. DO NOT do this for new objects!!! Instead specify new query packets. */ switch (object) @@ -5126,9 +5130,9 @@ remote_read_partial (struct target_ops *ops, enum target_object object, return -1; } - /* Note: a zero BUF, OFFSET and LEN can be used to query the minimum + /* Note: a zero OFFSET and LEN can be used to query the minimum buffer size. */ - if (buf == NULL && offset == 0 && len == 0) + if (offset == 0 && len == 0) return (rs->remote_packet_size); /* Minimum outbuf size is (rs->remote_packet_size) - if bufsiz is not large enough let the caller. */ @@ -5141,7 +5145,7 @@ remote_read_partial (struct target_ops *ops, enum target_object object, error ("remote query is only available after target open"); gdb_assert (annex != NULL); - gdb_assert (buf != NULL); + gdb_assert (readbuf != NULL); *p2++ = 'q'; *p2++ = query_type; @@ -5165,9 +5169,9 @@ remote_read_partial (struct target_ops *ops, enum target_object object, if (i < 0) return i; - getpkt (buf, len, 0); + getpkt (readbuf, len, 0); - return strlen (buf); + return strlen (readbuf); } static void @@ -5445,7 +5449,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_pid_to_str = remote_pid_to_str; remote_ops.to_extra_thread_info = remote_threads_extra_info; remote_ops.to_stop = remote_stop; - remote_ops.to_read_partial = remote_read_partial; + remote_ops.to_xfer_partial = remote_xfer_partial; remote_ops.to_rcmd = remote_rcmd; remote_ops.to_stratum = process_stratum; remote_ops.to_has_all_memory = 1; @@ -5965,7 +5969,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; remote_async_ops.to_pid_to_str = remote_pid_to_str; remote_async_ops.to_extra_thread_info = remote_threads_extra_info; remote_async_ops.to_stop = remote_stop; - remote_async_ops.to_read_partial = remote_read_partial; + remote_async_ops.to_xfer_partial = remote_xfer_partial; remote_async_ops.to_rcmd = remote_rcmd; remote_async_ops.to_stratum = process_stratum; remote_async_ops.to_has_all_memory = 1; |