Add debugging information to GAS?
Hans-Peter Nilsson
hp@bitrange.com
Mon Sep 30 09:49:00 GMT 2002
On 30 Sep 2002, Nick Clifton wrote:
> Hi Martin,
>
> > I use ARM and I want to debug my assemble programs with gdb. But I
> > don't know how to add debugging information into .elf file. if I use
> > "arm-elf-gcc -g -o hello.s",the option "-g" does noting. Who can
> > give me help? Thanks in advance.
>
> Try adding -Wa,--gdwarf2
No, that's the option for *assembly source* files; not files
generated by gcc (C source files).
The gcc option is -gdwarf-2. If the target has DWARF2 as its
default debug format (perhaps not the release you're using),
then it's implied by -g.
Note that this is the wrong forum for gcc questions. It's
suitable for discussing the --gdwarf2 option though. :-)
brgds, H-P
More information about the Binutils
mailing list