2003-03-04 Theodore A. Roth * gdb/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. Index: gdb/avr-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/avr-tdep.c,v retrieving revision 1.25 diff -u -r1.25 avr-tdep.c --- gdb/avr-tdep.c 27 Feb 2003 17:48:46 -0000 1.25 +++ gdb/avr-tdep.c 4 Mar 2003 20:48:51 -0000 @@ -1278,7 +1278,10 @@ 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);