如何阻止GDB执行“break main” Eclipse 中默认吗?

发布于 2024-10-04 05:46:49 字数 335 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宣告ˉ结束 2024-10-11 05:46:49

确保您处于 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 the Debugger tab, and uncheck Stop on startup at: checkbox.

EDIT: you can see a screen-shot here: Method/Function Breakpoints in Eclipse CDT

青朷 2024-10-11 05:46:49

要为任何新启动设置它,请在菜单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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文