unreadable gdb symbols

Asked by aeronova

Hi all,

I tried to figure out what gives seg fault with gdb, but its messages contained "?? ()" rather than readable strings. The below is what I got:

0x0000000000000001 in ?? ()
(gdb) bt
#0 0x0000000000000001 in ?? ()
#1 0x00007fffffffe536 in ?? ()
#2 0x0000000000000000 in ?? ()

I wonder what I need to do/install to get readable messages so that I can work on fixing my code. Please help me with this problem. Thank you in adv.

K. Lee.

Question information

English Edit question
Ubuntu gdb Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :

build your binary with -g to enable debugging symbols, and disable optimisations.

Revision history for this message
aeronova (aeronova) said :

mycae, thanks to reply, but I already had the -g option:

CC = mpicc
CXX = mpicxx
CXXFLAGS = -m64 -c -g -Wall
LDFLAGS = -m64

Revision history for this message
mycae (mycae) said :

We need to know more about your situation.

 The only way that debugging symbols are going to be missing is if you have not passed -g successfully, or have later run "strip" over the binary objects, or are calling a library that does not have debugging symbols (though higher up your call stack you should see your symbols anyway, if this is the case).

Your (makefile? env?) snippet does not show whether those flags are actually going to be passed to the compiler, or if they will be dropped at some point -- a more complete example is needed. Can you provide a complete example?

You may want to avoid using mpicc (and thus only having indirect control over gcc) and instead look at the flags that mpicc passes to gcc. Try the -echo option for mpicc.

Revision history for this message
aeronova (aeronova) said :

Hi mycae,

I think I found the problem; it was caused by using the same makefile used for building a shared library to compile an executable. It was a silly mistake. I took out -shared option in linking, and it worked fine. I also tested gdb with a gdb-example on a website, and I was able to see the debug symbols. Thank you for your help.

K. Lee.