aboutsummaryrefslogtreecommitdiff
path: root/gdb/kod.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-10-17 18:24:49 +0000
committerAndrew Cagney <cagney@redhat.com>2003-10-17 18:24:49 +0000
commit1e3ff5ad7f7cd527f735fe5f36e20ba378f87f96 (patch)
tree385856bbf343c1930a92bd7acf791ac3a839a1dd /gdb/kod.c
parent4b71bec021130a4ed50378864ef1807083c78adc (diff)
downloadgdb-1e3ff5ad7f7cd527f735fe5f36e20ba378f87f96.zip
gdb-1e3ff5ad7f7cd527f735fe5f36e20ba378f87f96.tar.gz
gdb-1e3ff5ad7f7cd527f735fe5f36e20ba378f87f96.tar.bz2
2003-10-17 Andrew Cagney <cagney@redhat.com>
* target.h (struct target_ops): Add "to_read_partial" and "to_write_partial", delete "to_query". (target_read_partial, target_write_partial): Declare. (target_read, target_write): Declare. (target_query): Delete macro. * target.c (target_read_partial): New function. (target_write_partial, target_read, target_write): New function. (update_current_target): Delete inheritance of "to_query". Add comments about "to_read_partial" and "to_write_partial". (debug_to_partial_read, debug_to_partial_write): New functions. (debug_to_query): Delete function. (setup_target_debug): Set "to_read_partial" and "to_write_partial" instead of "to_query". * remote.c (remote_read_partial): Replace "remote_query". (init_remote_ops): Set "to_read_partial" instead of "to_query". (init_remote_async_ops): Ditto. * kod.c (gdb_kod_query): Make "bufsize" a LONGEST. Use "target_read_partial" instead of "target_query". * avr-tdep.c (avr_io_reg_read_command): Make "bufsize" a LONGEST. Use "target_read_partial" instead of "target_query".
Diffstat (limited to 'gdb/kod.c')
-rw-r--r--gdb/kod.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/kod.c b/gdb/kod.c
index 8f565bb..e2bae91 100644
--- a/gdb/kod.c
+++ b/gdb/kod.c
@@ -87,11 +87,13 @@ gdb_kod_display (char *arg)
static void
gdb_kod_query (char *arg, char *result, int *maxsiz)
{
- int bufsiz = 0;
+ LONGEST bufsiz = 0;
- /* Check if current target has remote_query capabilities.
- If not, it does not have kod either. */
- if (! current_target.to_query)
+ /* Check if current target has remote_query capabilities. If not,
+ it does not have kod either. */
+ bufsiz = target_read_partial (&current_target, TARGET_OBJECT_KOD,
+ NULL, NULL, 0, 0);
+ if (bufsiz < 0)
{
strcpy (result,
"ERR: Kernel Object Display not supported by current target\n");
@@ -99,7 +101,6 @@ gdb_kod_query (char *arg, char *result, int *maxsiz)
}
/* Just get the maximum buffer size. */
- target_query ((int) 'K', 0, 0, &bufsiz);
/* Check if *we* were called just for getting the buffer size. */
if (*maxsiz == 0)
@@ -119,7 +120,8 @@ gdb_kod_query (char *arg, char *result, int *maxsiz)
error ("kod: query argument too long");
/* Send actual request. */
- if (target_query ((int) 'K', arg, result, &bufsiz))
+ if (target_read_partial (&current_target, TARGET_OBJECT_KOD,
+ arg, result, 0, bufsiz) < 0)
strcpy (result, "ERR: remote query failed");
}