As Oliver Večerník wrote:

> it seems to go in an endless loop after issuing `(gdb) i io':

> (gdb) i io
> GDB: <qRavr.io_reg>
> 
> GDB: (io registers) Read 64 bytes from 0x20
> ->GDB: 62
> GDB: <qRavr.io_reg>
> 
> GDB: (io registers) Read 64 bytes from 0x20
> ->GDB: 62
> GDB: <qRavr.io_reg>
> 
> GDB: (io registers) Read 64 bytes from 0x20
> ->GDB: 62
> GDB: <qRavr.io_reg>
> 
> GDB: (io registers) Read 64 bytes from 0x20
> ->GDB: 62
> GDB: <qRavr.io_reg>
> 
> GDB: (io registers) Read 64 bytes from 0x20
> ->GDB: 62
> 
> [...] <- loops forever

That appears to be a bug in GDB to me.

The first response to the qRavr.io_reg query is just the register
count (62 in your case).  Afterwards, GDB is supposed to fetch the
individual registers in small blocks.

Here how it looked for me (AVR-GDB 7.3.1, AVaRICE running on an
ATmega1284P which has a few more IO registers than your ATmega164P):

GDB: <qRavr.io_reg>

GDB: (io registers) Read 64 bytes from 0x20
->GDB: 71
GDB: <qRavr.io_reg:0,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 08 00 00 00 20 00 00 00 
recv: 0x1b
recv: 0x0d
recv: 0x00
recv: 0x09
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 9 bytes
read:  82 00 00 00 00 00 00 03 00
recv: 0xea
recv: 0x1c
CRC OK
Got message seqno 13 (command_sequence == 13)
response: 82 00 00 00 00 00 00 03 00 
->GDB: PINA,00;DDRA,00;PORTA,00;PINB,00;DDRB,00;PORTB,00;PINC,03;DDRC,00;
GDB: <qRavr.io_reg:8,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 04 00 00 00 28 00 00 00 
recv: 0x1b
recv: 0x0e
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read:  82 00 03 00 00
recv: 0xda
recv: 0x92
CRC OK
Got message seqno 14 (command_sequence == 14)
response: 82 00 03 00 00 
jtagRead 
command[0x05, 1]: 05 20 04 00 00 00 35 00 00 00 
recv: 0x1b
recv: 0x0f
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read:  82 00 00 00 00
recv: 0xeb
recv: 0xf8
CRC OK
Got message seqno 15 (command_sequence == 15)
response: 82 00 00 00 00 
->GDB: PORTC,00;PIND,03;DDRD,00;PORTD,00;TIFR0,00;TIFR1,00;TIFR2,00;TIFR3,00;
GDB: <qRavr.io_reg:10,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 08 00 00 00 3B 00 00 00 
recv: 0x1b
recv: 0x10
recv: 0x00
recv: 0x09
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 9 bytes
read:  82 00 00 00 00 00 00 67 0f
recv: 0x16
recv: 0xb1
CRC OK
Got message seqno 16 (command_sequence == 16)
response: 82 00 00 00 00 00 00 67 0F 
->GDB: PCIFR,00;EIFR,00;EIMSK,00;GPIOR0,00;EECR,00;EEDR,00;EEARL,67;EEARH,0f;
GDB: <qRavr.io_reg:18,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 06 00 00 00 43 00 00 00 
recv: 0x1b
recv: 0x11
recv: 0x00
recv: 0x07
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 7 bytes
read:  82 00 00 00 00 00 00
recv: 0x94
recv: 0x43
CRC OK
Got message seqno 17 (command_sequence == 17)
response: 82 00 00 00 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 4A 00 00 00 
recv: 0x1b
recv: 0x12
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0xad
recv: 0xd4
CRC OK
Got message seqno 18 (command_sequence == 18)
response: 82 00 00 
->GDB: 
GTCCR,00;TCCR0A,00;TCCR0B,00;TCNT0,00;OCR0A,00;OCR0B,00;GPIOR1,00;GPIOR2,00;
GDB: <qRavr.io_reg:20,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 03 00 00 00 4C 00 00 00 
recv: 0x1b
recv: 0x13
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 00 00 00
recv: 0x48
recv: 0xc2
CRC OK
Got message seqno 19 (command_sequence == 19)
response: 82 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 50 00 00 00 
recv: 0x1b
recv: 0x14
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 30 00
recv: 0xdd
recv: 0x8a
CRC OK
Got message seqno 20 (command_sequence == 20)
response: 82 30 00 
jtagRead 
command[0x05, 1]: 05 20 03 00 00 00 53 00 00 00 
recv: 0x1b
recv: 0x15
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 00 17 00
recv: 0xa6
recv: 0xef
CRC OK
Got message seqno 21 (command_sequence == 21)
response: 82 00 17 00 
->GDB: SPCR,00;SPSR,00;SPDR,00;ACSR,30;OCDR,00;SMCR,00;MCUSR,17;MCUCR,00;
GDB: <qRavr.io_reg:28,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 57 00 00 00 
recv: 0x1b
recv: 0x16
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0xc2
recv: 0x90
CRC OK
Got message seqno 22 (command_sequence == 22)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 5B 00 00 00 
recv: 0x1b
recv: 0x17
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x3f
recv: 0xdd
CRC OK
Got message seqno 23 (command_sequence == 23)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 05 00 00 00 5D 00 00 00 
recv: 0x1b
recv: 0x18
recv: 0x00
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  82 ff 40 00 00 00
recv: 0xe8
recv: 0x06
CRC OK
Got message seqno 24 (command_sequence == 24)
response: 82 FF 40 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 64 00 00 00 
recv: 0x1b
recv: 0x19
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0xea
recv: 0x06
CRC OK
Got message seqno 25 (command_sequence == 25)
response: 82 00 
->GDB: SPMCSR,00;RAMPZ,00;SPL,ff;SPH,40;SREG,00;WDTCSR,00;CLKPR,00;PRR0,00;
GDB: <qRavr.io_reg:30,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 65 00 00 00 
recv: 0x1b
recv: 0x1a
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 98
recv: 0x45
recv: 0xa5
CRC OK
Got message seqno 26 (command_sequence == 26)
response: 82 00 98 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 68 00 00 00 
recv: 0x1b
recv: 0x1b
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0xa3
recv: 0x91
CRC OK
Got message seqno 27 (command_sequence == 27)
response: 82 00 00 
jtagRead 
command[0x05, 1]: 05 20 04 00 00 00 6B 00 00 00 
recv: 0x1b
recv: 0x1c
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read:  82 00 00 00 00
recv: 0xdd
recv: 0x6a
CRC OK
Got message seqno 28 (command_sequence == 28)
response: 82 00 00 00 00 
->GDB: 
PRR1,00;OSCCAL,98;PCICR,00;EICRA,00;PCMSK0,00;PCMSK1,00;PCMSK2,00;TIMSK0,00;
GDB: <qRavr.io_reg:38,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 03 00 00 00 6F 00 00 00 
recv: 0x1b
recv: 0x1d
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 00 00 00
recv: 0x95
recv: 0x8b
CRC OK
Got message seqno 29 (command_sequence == 29)
response: 82 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 73 00 00 00 
recv: 0x1b
recv: 0x1e
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x08
recv: 0xef
CRC OK
Got message seqno 30 (command_sequence == 30)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 7A 00 00 00 
recv: 0x1b
recv: 0x1f
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0x3f
recv: 0x21
CRC OK
Got message seqno 31 (command_sequence == 31)
response: 82 00 00 
->GDB: TIMSK1,00;TIMSK2,00;TIMSK3,00;PCMSK3,00;[-- ADCL --],00;[-- ADCH 
--],00;ADCSRA,00;ADCSRB,00;
GDB: <qRavr.io_reg:40,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 7C 00 00 00 
recv: 0x1b
recv: 0x20
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x70
recv: 0x3c
CRC OK
Got message seqno 32 (command_sequence == 32)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 05 00 00 00 7E 00 00 00 
recv: 0x1b
recv: 0x21
recv: 0x00
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  82 00 00 00 00 00
recv: 0xb0
recv: 0x22
CRC OK
Got message seqno 33 (command_sequence == 33)
response: 82 00 00 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 84 00 00 00 
recv: 0x1b
recv: 0x22
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0x4a
recv: 0xaa
CRC OK
Got message seqno 34 (command_sequence == 34)
response: 82 00 00 
->GDB: 
ADMUX,00;DIDR0,00;DIDR1,00;TCCR1A,00;TCCR1B,00;TCCR1C,00;TCNT1L,00;TCNT1H,00;
GDB: <qRavr.io_reg:48,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 06 00 00 00 86 00 00 00 
recv: 0x1b
recv: 0x23
recv: 0x00
recv: 0x07
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 7 bytes
read:  82 00 00 00 00 00 00
recv: 0x28
recv: 0xcd
CRC OK
Got message seqno 35 (command_sequence == 35)
response: 82 00 00 00 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 90 00 00 00 
recv: 0x1b
recv: 0x24
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0x98
recv: 0x42
CRC OK
Got message seqno 36 (command_sequence == 36)
response: 82 00 00 
->GDB: 
ICR1L,00;ICR1H,00;OCR1AL,00;OCR1AH,00;OCR1BL,00;OCR1BH,00;TCCR3A,00;TCCR3B,00;
GDB: <qRavr.io_reg:50,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 92 00 00 00 
recv: 0x1b
recv: 0x25
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x68
recv: 0x4e
CRC OK
Got message seqno 37 (command_sequence == 37)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 07 00 00 00 94 00 00 00 
recv: 0x1b
recv: 0x26
recv: 0x00
recv: 0x08
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 8 bytes
read:  82 00 00 00 00 00 00 00
recv: 0x3f
recv: 0xf8
CRC OK
Got message seqno 38 (command_sequence == 38)
response: 82 00 00 00 00 00 00 00 
->GDB: 
TCCR3C,00;TCNT3L,00;TCNT3H,00;ICR3L,00;ICR3H,00;OCR3AL,00;OCR3AH,00;OCR3BL,00;
GDB: <qRavr.io_reg:58,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 9B 00 00 00 
recv: 0x1b
recv: 0x27
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x92
recv: 0xd5
CRC OK
Got message seqno 39 (command_sequence == 39)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 05 00 00 00 B0 00 00 00 
recv: 0x1b
recv: 0x28
recv: 0x00
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  82 00 00 00 00 00
recv: 0x75
recv: 0x0a
CRC OK
Got message seqno 40 (command_sequence == 40)
response: 82 00 00 00 00 00 
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 B6 00 00 00 
recv: 0x1b
recv: 0x29
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x47
recv: 0x0e
CRC OK
Got message seqno 41 (command_sequence == 41)
response: 82 00 
jtagRead 
command[0x05, 1]: 05 20 01 00 00 00 B8 00 00 00 
recv: 0x1b
recv: 0x2a
recv: 0x00
recv: 0x02
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 2 bytes
read:  82 00
recv: 0x40
recv: 0xd8
CRC OK
Got message seqno 42 (command_sequence == 42)
response: 82 00 
->GDB: OCR3BH,00;TCCR2A,00;TCCR2B,00;TCNT2,00;OCR2A,00;OCR2B,00;ASSR,00;TWBR,00;
GDB: <qRavr.io_reg:60,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 05 00 00 00 B9 00 00 00 
recv: 0x1b
recv: 0x2b
recv: 0x00
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  82 f8 fe ff 00 00
recv: 0x9e
recv: 0xde
CRC OK
Got message seqno 43 (command_sequence == 43)
response: 82 F8 FE FF 00 00 
jtagRead 
command[0x05, 1]: 05 20 03 00 00 00 C0 00 00 00 
recv: 0x1b
recv: 0x2c
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 20 00 06
recv: 0xc6
recv: 0x2b
CRC OK
Got message seqno 44 (command_sequence == 44)
response: 82 20 00 06 
->GDB: TWSR,f8;TWAR,fe;TWDR,ff;TWCR,00;TWAMR,00;UCSR0A,20;UCSR0B,00;UCSR0C,06;
GDB: <qRavr.io_reg:68,8>

GDB: (io registers) Read 64 bytes from 0x20
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 C4 00 00 00 
recv: 0x1b
recv: 0x2d
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0x96
recv: 0x07
CRC OK
Got message seqno 45 (command_sequence == 45)
response: 82 00 00 
jtagRead 
command[0x05, 1]: 05 20 03 00 00 00 C8 00 00 00 
recv: 0x1b
recv: 0x2e
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 20 00 06
recv: 0xe4
recv: 0x80
CRC OK
Got message seqno 46 (command_sequence == 46)
response: 82 20 00 06 
jtagRead 
command[0x05, 1]: 05 20 02 00 00 00 CC 00 00 00 
recv: 0x1b
recv: 0x2f
recv: 0x00
recv: 0x03
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 3 bytes
read:  82 00 00
recv: 0xd8
recv: 0x5f
CRC OK
Got message seqno 47 (command_sequence == 47)
response: 82 00 00 
->GDB: UBRR0L,00;UBRR0H,00;[-- UDR0 
--],00;UCSR1A,20;UCSR1B,00;UCSR1C,06;UBRR1L,00;UBRR1H,00;
GDB: <qRavr.io_reg:70,1>

GDB: (io registers) Read 64 bytes from 0x20
->GDB: [-- UDR1 --],00;

(Of course, that message "Read 64 bytes from 0x20" is hard-coded
nonsense.  That should be replaced by a message telling what's really
going on...)

As you can see, GDB is supposed to issue subsequent statements like:

GDB: <qRavr.io_reg:0,8>

in order to fetch 8 IO registers starting at address 0.  Your GDB
doesn't do this, but instead continues the first query packet (the one
without the colon), so AVaRICE just reports the register count over
and over again.
-- 
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
avarice-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avarice-user

Reply via email to