如何阻止 GDB 执行“break main"默认情况下在 Eclipse 中? [英] How to stop GDB from executing "break main" by default in Eclipse?

查看:23
本文介绍了如何阻止 GDB 执行“break main"默认情况下在 Eclipse 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Eclipse 和 MinGW 开发一个 C 项目.运行此项目的调试版本时,gdb 总是在输入 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.

我读到有一个命令

(gdb) break main

从命令行运行时会完成相同的行为.

which will accomplish the same behavior when running from the command line.

目前我没有 .gdbinit 文件.

At the moment I do NOT have a .gdbinit file.

目前 gdb 在从命令行运行时不会在进入 main 时停止,但在从 Eclipse 运行时会停止.

At the moment gdb doesn't stop on entering main when running from the command line, but it does when running from Eclipse.

如何让 GDB 在 Eclipse 中默认进入 main 时停止中断?

How do I make GDB stop breaking on entering main by default within Eclipse?

推荐答案

确保你在 c++ 透视图中,然后转到菜单 Run -> Debug Configurations.确保在左侧窗格中选择了您的应用程序,按 Debugger 选项卡,然后取消选中 Stop on startup at: 复选框.

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.

您可以在此处查看屏幕截图:Method/Eclipse CDT 中的函数断点

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

这篇关于如何阻止 GDB 执行“break main"默认情况下在 Eclipse 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆