From 91ccbfc19ebdc09280449dec42a28a4f934a68dd Mon Sep 17 00:00:00 2001 From: "Theodore A. Roth" Date: Wed, 5 Mar 2003 00:19:56 +0000 Subject: * 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. --- gdb/avr-tdep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdb/avr-tdep.c') 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); -- cgit v1.1