avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Re: Yet another Avr-gcc_Simulavr_Avr-Gdb_DDD-howto,


From: Erik Christiansen
Subject: Re: [avr-gcc-list] Re: Yet another Avr-gcc_Simulavr_Avr-Gdb_DDD-howto, Was: Re: avr-libc install problem
Date: Tue, 19 Aug 2003 18:05:35 +1000
User-agent: Mutt/1.3.28i

On Mon, Aug 18, 2003 at 12:24:23PM -0700, Theodore A. Roth wrote:
> You can learn a bit about how to use gdb by using ddd. Watch the gdb
> output when you do the the GUI in ddd and you can get a clue as to
> what gdb commands are been used.
   
   OK, but gdb is giving better return on investment so far. (See ddd
   attempt at email end.) Just following simulavr/README.gdb, connection
   is a doddle, and skipping the gruesome bit where simulavr printed
   23854 lines of complaint when gdb was asked to "step" with SP
   uninitialised, take two does a "stepi" over the interrupt vectors,
   and we have lift-off!:

   $ avr-gdb app.elf
   ...
   This GDB was configured as "--host=i686-pc-linux-gnu --target=avr"...
   (no debugging symbols found)...
   (gdb) target remote localhost:1212
   Remote debugging using localhost:1212
   0x00000000 in ?? ()
   (gdb) load
   Loading section .text, size 0xbe lma 0x0
   Loading section .data, size 0x202 lma 0xbe
   Start address 0x0, load size 704
   Transfer rate: 5632 bits in <1 sec, 32 bytes/write.
   (gdb) stepi
   0x00000046 in _start ()
   (gdb)

   Now though, the manual's assertion that the print command "evaluates
   and prints the value of an expression of the language your program is
   written in" seems not to be the whole story:

   (gdb) print SP
   No symbol table is loaded.  Use the "file" command.
   (gdb) file /usr/local/avr/avr/include/avr/io.h
   A program is being debugged already.  Kill it? (y or n)

   Errr, no thanks, I'd just like to help gdb grok avr assembler.
   (So, back to the manual.)
                          -------------------

   OK, how about ddd?. After poking around the ddd manpage, tried:

   $ simulavr -d atmega16 -g                

   $ ddd --debugger avr-gdb io.elf          but simulavr remained:

Waiting on port 1212 for gdb client to connect...

                          -------------------

> Also, read the gdb manual. There's an aweful lot of good information
> in it. I bought a printed copy back in 1996 that is still useable
> today...

   Ooh-Err, I believe you now. It _was_ necessary to resort to the
   manual, to learn that "stepi" is needed for machine instruction
   stepping. (But some things, like command line history and filename
   completion, are more quickly discovered empirically.)

   Now to try to find out how to supplement its symbol table. (The
   manpage informs that "info gdb" has the manual's content, so that's
   my current reference.)

Regards,
Erik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]