tags:

views:

74

answers:

3

I'm trying to run my app on gdb. Therefore I compiled it with the 'g' option. But when I'm running gdb ./app I get:

DW_FORM_strp pointing outside of .debug_str section [in module /home/w/app]

And I cannot do any break:

(gdb) break main
No symbol table is loaded.  Use the "file" command. 
(gdb) . 
A: 

Did you also link with -g?

Nathan Fellman
Maybe should i add proptypes somewhere? i mean to header file ?? Its very stragne - the thing is, im working on a project in which i had to add two functions into one of its C files. When i added them, i started receivng that communicte. When i got latest version of file which im editing from cvs (before my changes), everything seems to work fine....
JosiP
+1  A: 

Most likely you've compiled your program with a newer version of GCC, but are debugging it with an old GDB.

Else, you have a buggy GCC version, which puts incorrect debug info into your executable.

Employed Russian
A: 

Use 'objdump -W' to look at the Elf file's Dwarf debug information to see the .debug_str table.

Each DW_FORM_strp is an offset into this table.

Compiling with -g (or -g-dwarf2) puts the Dwarf information in each object file with its own portion of .debug_str section strings.

Linking those object files with -g tries to make unique strings and doesn't update all the DW_FORM_strp offsets properly. Seen with gcc 4.3.4's ld.

We were pasing CC_FLAGS to a makefile link step by accident.

Workaround : don't link with -g flag.

DavidExarm