views:

378

answers:

2

Hi

I'm trying to use GDB and KDEvelop to debug a console app under Knoppix VM. KDevelop and GDB don't break at my breakpoints. I suspect it's because they don't have debug symbols.

If I'm correct how do I need to change my Makefile to create those. Maybe the problem is somewhere else?

Regards, Ariel

+4  A: 

Include -g in the flags sent to the compiler and linker. The default variables for this are CFLAGS and LDFLAGS respectively.

dmckee
The "-g" option only needs to be given to the compiler via the CFLAGS macro. It's not necessary to have it in the LDFLAGS macro.
Steve Emmerson
Cargo cult knowledge, I guess. At some point I used a linker that had to be told *not* to throw away the debugging symbols...
dmckee
A: 

If you are able to see source and set the breakpoint, then you probably have debugging symbols established. However, the usual sequence is:

gcc -g -o (outputname) (source files...)
gdb outputname

Give more specifics about what you are doing and what messages you see and we can be more specific.

wallyk