如何阻止GDB执行“break main” Eclipse 中默认吗?
我正在使用 Eclipse 和 MinGW 开发一个 C 项目。运行此项目的调试版本时,gdb 总是在输入 main()
时中断。我可以理解为什么这可能有用,但对于我当前的项目,我不希望这种情况发生。
我读到有一个命令
(gdb) break main
可以在从命令行运行时完成相同的行为。
目前我没有 .gdbinit 文件。
目前,从命令行运行时 gdb 不会在输入 main 时停止,但从 Eclipse 运行时会停止。
如何让 GDB 在 Eclipse 中默认进入 main 时停止中断?
I'm working on a C project with Eclipse and MinGW. When running a debug build of this project, gdb always breaks on entering main()
. I can see why this could be useful, but for my current project I don't want that to happen.
I've read that there is a command
(gdb) break main
which will accomplish the same behavior when running from the command line.
At the moment I do NOT have a .gdbinit file.
At the moment gdb doesn't stop on entering main when running from the command line, but it does when running from Eclipse.
How do I make GDB stop breaking on entering main by default within Eclipse?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您处于 c++ 视角,然后转到菜单
Run
->调试配置
。确保在左侧窗格中选择您的应用程序,按“调试器”选项卡,然后取消选中“启动时停止于:”复选框。编辑:您可以在此处看到屏幕截图: 方法/函数断点Eclipse CDT
Make sure you are in the c++ perspective, then go to menu
Run
->Debug Configurations
. Make sure your application is chosen in the left pane, press theDebugger
tab, and uncheckStop on startup at:
checkbox.EDIT: you can see a screen-shot here: Method/Function Breakpoints in Eclipse CDT
要为任何新启动设置它,请在菜单Window->Preferences上,选择左侧的C/C++->Debug->GDB项,然后转到调试配置默认值部分,并取消选中 CDT 8.0 或更高版本上的“启动时停止于:”复选框。
您可以在此处查看详细信息:如何防止调试器在第一行停止?
To set it for any new launch, On the menu Window->Preferences, Select C/C++->Debug->GDB item on the left, and then go to the Debug Configurations Defaults section and uncheck the "Stop at startup at:" checkbox on CDT 8.0 or later.
You can see the details here: How do I prevent the debugger from stopping on the first line?