I try to debug with jtag on an AVR 8 bit microcontroller.
avarice --jtag /dev/ttyUSB0 :4444
ddd lcd --debugger avr-gdb
in the session I do:
target remote localhost:4444
break main
Breakpoint 1 at 0x244: file lcd_test.cpp, line 254.
cont
Now the target stops and pc is correct:
But if I look at assembly code window, I have an offset of 0x800000 and the wrong content:
Dump of assembler code from 0x800244 to 0x800344:
0x00800244: ldd r1, Y+16 ; 0x10
0x00800246: std Z+8, r0 ; 0x08
0x00800248: sbc r8, r16
0x0080024a: xch Z, r16
0x0080024c: .word 0x0018 ; ????
0x0080024e: eor r1, r0
In native avr-gdb with layoit asm everything looks fine.
Any idea how to get the correct output from assembly window in DDD in connection with avr-gdb?
This is an very old bug in gdb! It was reported already in 2011. The bug report contains a patch which can be applied to current gdb version 9.1 and works as expected!
Also ddd must be patched with:
After the changes ddd with avr-gdb works.