1

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) . 
1
  • 1
    What OS and CPU ? Have you tried running gdb with a simple "Hello World" test app to make sure your basic gcc/gdb tool chain is installed and working OK ? Commented May 4, 2010 at 12:14

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.