diff options
author | Theodore A. Roth <troth@openavr.org> | 2003-03-05 00:19:56 +0000 |
---|---|---|
committer | Theodore A. Roth <troth@openavr.org> | 2003-03-05 00:19:56 +0000 |
commit | 91ccbfc19ebdc09280449dec42a28a4f934a68dd (patch) | |
tree | 0560257b2fa2794cb9bf537cac8b86f8a5a88b82 /gdb | |
parent | 001f9f100c6a4e888057b901828972543a65a60d (diff) | |
download | gdb-91ccbfc19ebdc09280449dec42a28a4f934a68dd.zip gdb-91ccbfc19ebdc09280449dec42a28a4f934a68dd.tar.gz gdb-91ccbfc19ebdc09280449dec42a28a4f934a68dd.tar.bz2 |
* avr-tdep.c (avr_io_reg_read_command): Fix to handle case when the
number of io registers reported by remote target is not a multiple of step.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/avr-tdep.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 329e864..b9eee63 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-03-04 Theodore A. Roth <troth@openavr.org> + + * avr-tdep.c (avr_io_reg_read_command): Fix to handle case when the + number of io registers reported by remote target is not a multiple of + step. + 2003-03-04 David Carlton <carlton@math.stanford.edu> * symtab.c (lookup_partial_symbol): Add linkage_name argument. diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 952b4e4..975132a 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1279,7 +1279,10 @@ avr_io_reg_read_command (char *args, int from_tty) for (i = 0; i < nreg; i += step) { - j = step - (nreg % step); /* how many registers this round? */ + /* how many registers this round? */ + j = step; + if ((i+j) >= nreg) + 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); |