Tuesday, August 12, 2008

debugging symbols




To tell if a file has been compiled with debugging symbols, just go


gdb file


or


gdb file.o


If it has debugging symbols you'll see something like:


devi 391 [~/mDEV/mirex2008] % gdb mirex_kea
GNU gdb Red Hat Linux (6.6-35.fc8rh)
Copyright (C) 2006 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-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb)


If it doesn't have debugging symbols you'll see something like:


devi 1847 [~/marsyas/debug] % gdb /usr/bin/gv
GNU gdb Red Hat Linux (6.6-35.fc8rh)
Copyright (C) 2006 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-redhat-linux-gnu"...

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/d6/54aa184d96b7219e549a595f6fd21b79bd2c98.debug
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb)