Unable to place breakpoint in gdb in emacs

I am trying to debug a small program written in C. I open the file in emacs, Mx gdb, gives the name of the program file (a.out). When I switch to the source file in the emacs panel and try to place a breakpoint in the main function, I get the message "There is no default breakpoint address now." and the breakpoint is not placed, so I cannot debug the program. I am compiling a program with the parameters gcc -Wall -ansi -pedantic-errors -Werror. Any ideas?

+3
source share
1 answer

for debugging in gdb you need to use the -g option, this will allow gdb to work with your output file by adding debug symbols to your binary

gcc -g file.cpp
+3
source

Source: https://habr.com/ru/post/1744865/


All Articles