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: Wed, 20 Aug 2003 18:39:15 +1000
User-agent: Mutt/1.3.28i

On Tue, Aug 19, 2003 at 09:04:23AM -0700, Theodore A. Roth wrote:
> You use -g for C files compiled with the C backend and --gstabs for
> asm files assembled with gas.
> 
> NOTE: you never want to compile C code with both -g and -Wa,--gstabs.
> You get two competing sets of symbols and gdb goes all wonky (spent 2
> weeks last year tracking that one down).
> 

Ouch! (I had no idea what I've been spared, using e.g. powerpc-linux-as
directly.) Thanks for sharing the fruits of your sleuthing. It sounds
like that has to be the fix. However,

avr-objdump -G app.elf

then showed SLINE guff, but still no symbols such as SPH. Quite
reasonably, nm showed no more symbols either.

However, defining these symbols in assembler makes them visible to nm,
and therefore gdb:

SPH = 0x3e           ; In the source fixes the problem:

0000003e a SPH       <- nm app.elf
0000003d a SPL

(gdb) p /x SPH       <- Hooray! 
$4 = 0x18

It won't take much to script the conversion of all the relevant header
#defines to assembler definitions. (Then I can go back to using avr-as
explicitly. No more cpp mysteries. :-))

To add to a frabjous day, ddd and I now get along better too. Granted,
it complains "No Source", but File->Open_Source fixed that, and we can
stepi!

Now, if I can just find a window that displays the registers, I'll be
won over to the GUI.

> PS: Any chance you could not indent your messages? When mixed in with
> replies it makes for a tough read.

Yup, certainly! (Kept it up for one whole email. Let's see if I can do
it twice in a row. :)

Do you think it might be worthwhile for me to have a go at merging the
nub of your simulavr/README.gdb, and couple of lines of "How to achieve
lift-off in 27 easy keystrokes" into a brief EXAMPLES section in your
simulavr manpage? (Mind you, once in there, DESCRIPTION wouldn't be
safe. A few well chosen additional sentences would be very helpful to
those of us whose feet slip madly, without that extra bit of doco for
traction.)

Thanks for all the help in getting me this far.

Erik


reply via email to

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