help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb backtrace for g++ programs showing ?? symbol


From: Paul Pluzhnikov
Subject: Re: gdb backtrace for g++ programs showing ?? symbol
Date: Sat, 23 Feb 2008 13:45:10 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Jeff Schwab <jeff@schwabcenter.com> writes:

>> Why can't gdb show me the function name for that function?
>
> Because it can't find the debug symbols for the file.

Gdb doen't need any debug symbols to deduce function name:

$ cat t.c && gcc t.c && gdb -q ./a.out
void crash()
{
    int *ip = (int*)0;
    ip[1] = 1;
}
void foo() { crash(); }
void bar() { foo(); }
int main() { bar(); return 0; }
(no debugging symbols found)...Using host libthread_db library 
"/lib/tls/libthread_db.so.1".
(gdb) r
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0804834f in crash ()
(gdb) bt
#0  0x0804834f in crash ()
#1  0x08048362 in foo ()
#2  0x0804836f in bar ()
#3  0x08048386 in main ()

Note the 'no debugging symbols found', and the names of all functions
in the stack trace. However, gdb does need the symbol table to
be present:

$ strip a.out && gdb -q ./a.out
(no debugging symbols found)...Using host libthread_db library 
"/lib/tls/libthread_db.so.1".
(gdb) r
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0804834f in ?? ()
(gdb) bt
#0  0x0804834f in ?? ()
#1  0x00000000 in ?? ()

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]