aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.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/avr-tdep.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/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 90bf910..e9c5d42 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1359,7 +1359,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
static void
avr_io_reg_read_command (char *args, int from_tty)
{
- int bufsiz = 0;
+ LONGEST bufsiz = 0;
char buf[400];
char query[400];
char *p;
@@ -1367,22 +1367,23 @@ avr_io_reg_read_command (char *args, int from_tty)
unsigned int val;
int i, j, k, step;
- if (!current_target.to_query)
+ /* Just get the maximum buffer size. */
+ bufsiz = target_read_partial (&current_target, TARGET_OBJECT_AVR,
+ NULL, NULL, 0, 0);
+ if (bufsiz < 0)
{
fprintf_unfiltered (gdb_stderr,
"ERR: info io_registers NOT supported by current "
"target\n");
return;
}
-
- /* Just get the maximum buffer size. */
- target_query ((int) 'R', 0, 0, &bufsiz);
if (bufsiz > sizeof (buf))
bufsiz = sizeof (buf);
/* Find out how many io registers the target has. */
strcpy (query, "avr.io_reg");
- target_query ((int) 'R', query, buf, &bufsiz);
+ target_read_partial (&current_target, TARGET_OBJECT_AVR, query, buf, 0,
+ bufsiz);
if (strncmp (buf, "", bufsiz) == 0)
{
@@ -1413,7 +1414,8 @@ avr_io_reg_read_command (char *args, int from_tty)
j = nreg - i; /* last block is less than 8 registers */
snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
- target_query ((int) 'R', query, buf, &bufsiz);
+ target_read_partial (&current_target, TARGET_OBJECT_AVR, query, buf,
+ 0, bufsiz);
p = buf;
for (k = i; k < (i + j); k++)