David Shochat <address@hidden> posted
address@hidden, excerpted below, on Mon, 03 Jul 2006
19:24:23 -0400:
Since I need to report a crash, I need to get a gdb stack trace. That
means I need to compile with debug (with symbols). How do I do that?
>From the gcc manpage:
-g Produce debugging information in the operating system's native format
(stabs, COFF, XCOFF, or DWARF 2). GDB can work with this debugging
information.
So add -g to your CFLAGS. (Set CFLAGS="-g" plus whatever other CFLAGS you
use before compiling.) Note that various optimizations can make debugging
difficult, of course. See the manpage for additional -g<otherstuff> flags.
Finally (and in general), note that symbols may be stripped by the
build/make script. I'm not sure if pan's does or not, but at the
./configure step, you can try ./configure --help and see what it spits
out. It's likely you can add a debug option there that will take care of
the gcc -g as well as any stripping.