tags:

views:

93

answers:

1

I'm trying to debug a small program I've written in C. I open up the file in emacs, M-x gdb, give the program filename (a.out). When i switch to the source file in the emacs pane, and try to place a breakpoint in the main function, I get the message "No default breakpoint address now." and the breakpoint doesn't place, so I can't debug the program. I'm compiling the program with the options gcc -Wall -ansi -pedantic-errors -Werror. Any ideas?

+3  A: 

to debug in gdb you have to use the -g option, this will let gdb work with your output file

gcc -g file.cpp
Peter Ajtai
ahh thanks, i totally forgot about that
Rowhawn
More than "working with gdb": '-g' adds debugging symbols to your binary.
Stephen