From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.66.193 with SMTP id h1mr149517obt.47.1391355576780; Sun, 02 Feb 2014 07:39:36 -0800 (PST) X-Received: by 10.140.91.72 with SMTP id y66mr820qgd.23.1391355576750; Sun, 02 Feb 2014 07:39:36 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!c10no8764576igq.0!news-out.google.com!y18ni189qap.1!nntp.google.com!k15no11616416qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 2 Feb 2014 07:39:36 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=187.56.96.25; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 187.56.96.25 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7a5e5723-44d4-4e84-a1c2-5f7320360ff8@googlegroups.com> Subject: Debug AVR with AVRICE From: "Rego, P." Injection-Date: Sun, 02 Feb 2014 15:39:36 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:18352 Date: 2014-02-02T07:39:36-08:00 List-Id: Hi, I am trying to debug an ATmega2560 using AVRICE mkII (JTAG) for a code compiled using Adacore avr-elf_windows. The idea is to debug a simple code to extend it to a more complex one. My target is an AVR ATmega2560, and I am using avarice in Windows 7x64. So I built this procedure Main is Counter : Integer := 0; Map : Integer := 0; begin for Index in 1 .. 1000 loop Counter := Counter + 1; Map := Counter + 2; for Index_Map in 1 .. 1000 loop Map := Map + Counter + 1; end loop; end loop; end Main; in command-line using avr-gnatmake -f src\main.adb -o bin\main.elf -g -Os -mmcu=avr6 --RTS=zfp -largs obj\crt1-atmega2560._o -nostdlib -lgcc -mavr6 -Tdata=0x00800200 and gdbserver is set using avarice -P atmega2560 -2 -j usb :9090 So I run avr-gdb from the bin target file. The problem is that the debug variables are not updated with the execution. See it. $avr-gdb bin/main.elf GNU gdb (GDB) 7.4.1 for GNAT GPL 2012 (20120509) [rev=gdb-7.4-ref-145-gb2b7897] Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. See your support agreement for details of warranty and support. If you do not have a current support agreement, then there is absolutely no warranty for this version of GDB. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-pc-mingw32 --target=avr". For bug reporting instructions, please see: ... Reading symbols from C:\xino\bin\main.elf...done. (gdb) target remote localhost:9090 Remote debugging using localhost:9090 0x00000000 in __vectors () (gdb) br main.adb:8 Breakpoint 1 at 0x148: file src\main.adb, line 8. (gdb) br main.adb:9 Note: breakpoint 1 also set at pc 0x148. Breakpoint 2 at 0x148: file src\main.adb, line 9. (gdb) c Continuing. Breakpoint 1, main () at src\main.adb:16 16 end Main; (gdb) counter $1 = 1 (gdb) c Continuing. Breakpoint 1, main () at src\main.adb:16 16 end Main; (gdb) c Continuing. Breakpoint 1, main () at src\main.adb:16 16 end Main; (gdb) c Continuing. Breakpoint 1, main () at src\main.adb:16 16 end Main; (gdb) counter $2 = 1 (gdb) counter $3 = 1 (gdb) c Continuing. Breakpoint 1, main () at src\main.adb:16 16 end Main; (gdb) counter $4 = 1 (line 8 is 'before' Counter := Counter + 1; and line 9 is after it). Other problem is that I would expect breakpoint 2 stops, which does not occur. So how can I do it right? Thanks. Rego.