gcc with -g option produces unreadable(via sdb or gdb) symbols

John Coolidge coolidge at cs.uiuc.edu
Fri May 3 10:25:00 AEST 1991


taylor at ddtg.com (Brad Taylor) writes:
> We have been experiencing some problems in our evaluation of the Apple port
>of gcc. When our code is compiled using the "-g" option, the symbol table
>info seems to get corrupted. The messages are something like this:

>When using sdb..."Warning: '<filename>' not compiled with -g option"

This is because gcc by default produces COFF-format dbx stabs
information (i.e. a hack) that isn't understandable by sdb. Gcc can be
hacked to produce sdb output (if you use A/UX's as rather than gas), but
I haven't tested it in quite a while.

>When using gdb..."main is not a function"

Haven't seen this one. Try running nm over the file that has main in it
and looking for debugging symbols; also, take a look at the assembly
output gcc produces for that file and see what's being output around
main. I'm not that much of an expert at the innards of gcc's debugger
output routines, but I can take a look and see if I can figure out
what's going wrong...

--John

--------------------------------------------------------------------------
John L. Coolidge     Internet:coolidge at cs.uiuc.edu   UUCP:uiucdcs!coolidge
Of course I don't speak for the U of I (or anyone else except myself)
Copyright 1991 John L. Coolidge. Copying allowed if (and only if) attributed.
You may redistribute this article if and only if your recipients may as well.



More information about the Comp.unix.aux mailing list