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
To use it, just set the list of variables to print on the command line, and include the debug target: $ make V="USERNAME SHELL" debug makefile:2: USERNAME = Owner makefile:2: SHELL = /bin/sh.exe make: debug is up to date. Now you can print variables by simply listing them on the command line.
Unfortunately, there is no such thing as a makefile debugger to examine how a particular rule is being evaluated or a variable expanded. Instead, most debugging is performed with simple print state- ments and by inspection of the makefile.
To add additional symbols you might use add-symbol-file . The add-symbol-file command reads additional symbol table information from the file filename. You would use this command when filename has been dynamically loaded (by some other means) into the program that is running.
A debug symbol is a special kind of symbol that attaches additional information to the symbol table of an object file, such as a shared library or an executable.
Include -g
in the flags sent to the compiler and linker. The default variables for this are CFLAGS
and LDFLAGS
respectively.
The second step: exclude -s
from flags (-s
means strip)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With