Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » AVR-GCC
  • » [avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ? [RSS Feed]

#1 Nov. 4, 2005 01:51:30

Erik C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


On Fri, Nov 04, 2005 at 02:08:19AM +0100, Vincent Trouilliez wrote:
> So far I have used the binaries of gcc-avr 3.4.3, that my distro
> (Ubuntu) supplies, and it seems it doesn't support the -gdwarf-2 flag.

Vincent,

Adding --with-dwarf2 to the configure options, when rebuilding
avr-gcc, should turn it on.

hth,
Erik


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Nov. 4, 2005 02:37:27

Vincent T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


> On Fri, Nov 04, 2005 at 02:08:19AM +0100, Vincent Trouilliez wrote:
> > So far I have used the binaries of gcc-avr 3.4.3, that my distro
> > (Ubuntu) supplies, and it seems it doesn't support the -gdwarf-2 flag.
>
> Vincent,
>
> Adding --with-dwarf2 to the configure options, when rebuilding
> avr-gcc, should turn it on.
>
> hth,
> Erik


Thanks Erik, that did it, and that also appears to have fixed my problem
with the disassembler output as well :-)


--
Vince



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Nov. 4, 2005 06:03:31

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


Vincent Trouilliez <> wrote:

> I put it therehttp://www.007.org.uk/~vtrouilliez/temp/it's the one
> called "object.list".

Something else must be wrong. The backannotated disassembly listing
is also supposed to work with stabs debugging.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#4 Nov. 4, 2005 06:17:22

Vincent T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


> > I put it therehttp://www.007.org.uk/~vtrouilliez/temp/it's the one
> > called "object.list".
>
> Something else must be wrong. The backannotated disassembly listing
> is also supposed to work with stabs debugging.


What I find (found) strange was that, if you look carefully at the file,
SOME functions, all from the same module (lcd), are annotated, and all
others aren't. I don't understand this, since the Makefile (as I
understand it) treats all source files 100% the same.
Now that I have enabled dwarf-2 and recompiled gcc, I noticed that I
still loose the annotations, if I use the -O3 optimisation flag, but not
if I use -O or -Os.
Weird indeed...


--
Vince



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#5 Nov. 4, 2005 16:01:27

Lars N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


* Joerg Wunsch <> :Vincent Trouilliez <> wrote:I put it therehttp://www.007.org.uk/~vtrouilliez/temp/it's the one
called "object.list".Something else must be wrong. The backannotated disassembly listing
is also supposed to work with stabs debugging.Indeed, I found the stabs+ debugging more useful than dwarf, as ddd/gdb had
problems with volatile variables.


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#6 Nov. 4, 2005 18:53:02

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


Lars Noschinski <> wrote:

> Indeed, I found the stabs+ debugging more useful than dwarf, as
> ddd/gdb had problems with volatile variables.

IIRC with all (global/static) variables. The offset 0x800000
for RAM access isn't being taken into account.

I've already wrote it elsewhere, it's merely incidentical that
avr-gdb already works with DWARF-2 at all. This has never
been designed or activated by someone for the AVR target, it's
only a by-product of DWARF-2 being enabled for GCC/GDB's major
platforms (i386/amd64).
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#7 Nov. 4, 2005 18:54:10

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


Vincent Trouilliez <> wrote:

> Now that I have enabled dwarf-2 and recompiled gcc, I noticed that I
> still loose the annotations, if I use the -O3 optimisation flag, but
> not if I use -O or -Os.

Keep in mind that -O3 will inline a lot of functions. That
could really confuse the dissassembly annotation.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#8 Nov. 5, 2005 18:04:55

Vincent T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


On Fri, 2005-11-04 at 19:53 +0100, Joerg Wunsch wrote:
> Vincent Trouilliez <> wrote:
>
> > Now that I have enabled dwarf-2 and recompiled gcc, I noticed that I
> > still loose the annotations, if I use the -O3 optimisation flag, but
> > not if I use -O or -Os.
>
> Keep in mind that -O3 will inline a lot of functions. That
> could really confuse the dissassembly annotation.

Ah, yet another reason to not use O3 then, as I stopped using _delay_ms
precisely to avoid all this in-line stuff... so I don't fancy the
compiler adding some more in my back ;-)

-Os seems the best for me, code is massively smaller than -O or -O3, yet
still readable I find, when I do need to look at the output.


--
Vince



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#9 Nov. 5, 2005 19:21:45

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ?


Vincent Trouilliez <> wrote:

> Ah, yet another reason to not use O3 then, as I stopped using
> _delay_ms precisely to avoid all this in-line stuff...

While I understand your sentiments in general, for the delay stuff,
it's basically necessary to avoid adding more overhead than needed.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

  • Root
  • » AVR-GCC
  • » [avr-gcc-list] Compiling gcc-avr : how to enable dwarf-2 option ? [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support