comp.lang.ada
 help / color / mirror / Atom feed
* Debug AVR with AVRICE
@ 2014-02-02 15:39 Rego, P.
  0 siblings, 0 replies; only message in thread
From: Rego, P. @ 2014-02-02 15:39 UTC (permalink / raw)


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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>...
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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-02 15:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02 15:39 Debug AVR with AVRICE Rego, P.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox