svn commit: r218984 - head/lib/librt
Dimitry Andric
dim at FreeBSD.org
Wed Feb 23 22:31:40 UTC 2011
On 2011-02-23 23:13, Bruce Evans wrote:
> Now found it easly using gcc -v. gcc -c -v foo.c produces "... /usr/bin/as
> -o foo.o /var/tmp/whatever.s", but gcc -c -v foo.s produces "... /usr/bin/as
> -gdwarf2 -o foo.o foo.s". gcc's generation of -gdwarf2 is inconsistent
> with itself. Do we use a nonstandard not-gdwarf2 option for the usual case
> but forget to change this for asm files?
I don't think so, but there is simply no need to pass '-g' in the gcc
invocation that assembles and links the .s file, since the debug info is
already embedded in the .s file itself.
E.g. the following works just fine:
$ cc -g -S hello.c
$ cc -o hello hello.s
$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.0 (900033), not stripped
$ gdb ./hello
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) list
1 #include <stdio.h>
2
3 int main(void)
4 {
5 puts("Hello World!");
6
7 return 0;
8 }
Apparently, if you use --gdwarf2 with GNU as 2.15, it messes up the
already existing debug info. It looks like 2.17.50 has no such problem,
though.
More information about the svn-src-all
mailing list