简体   繁体   English

无法在emacs中的gdb中放置断点

[英]Cannot place breakpoint in gdb in emacs

I'm trying to debug a small program I've written in C. I open up the file in emacs, Mx gdb, give the program filename (a.out). 我正在尝试调试我用C编写的一个小程序。我在emacs中打开文件,Mx gdb,给出程序文件名(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." 当我切换到emacs窗格中的源文件,并尝试在main函数中放置一个断点时,我收到消息“现在没有默认断点地址”。 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. 我正在使用选项gcc -Wall -ansi -pedantic-errors -Werror编译程序。 Any ideas? 有任何想法吗?

要在gdb中调试你必须使用-g选项,这将让gdb通过向二进制文件添加调试符号来处理输出文件

gcc -g file.cpp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM