[Top][All Lists]

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

Re: [avr-gcc-list] Assembly language help for a noob

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Assembly language help for a noob
Date: Fri, 14 Sep 2007 09:13:49 +0200 (MET DST)

Gre7g Luterman <address@hidden> wrote:

> Is there a way to turn on debug symbol creation in gcc on .S files?

In theory, by passing the option -gdwarf2 down to the assembler (by
prefixing it with -Wa, when called from the compiler).

However, this is currently broken for DWARF-2.  (It would work for
stabs, as -gstabs, but that's not supported by AVR Studio.)  The point
is, nobody really implemented DWARF-2 debugging for the AVR target.
Everything we've got so far has simply been inherited by the
mainstream GCC targets (i386, x86_64) moving to DWARF-2.  It might be
simple to fix it (-gdwarf2 *does* work on the i386 target), but it
requires someone needing it badly enough to really do it.

> Secondly, is there a good way to refer to offsets into a C structure
> within an assembly file?

Not that I know of.  In C, you can do this with the offsetof() macro,
but the underlying calculations are performed by the C compiler, not
by the preprocessor, so you cannot use them in an assembly file.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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