Eclipse CDT:在调试/运行之前跳过构建/构建

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9706136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:49:58  来源:igfitidea点击:

Eclipse CDT: Skip make/build before Debug/Run

eclipsedebuggingmakefileeclipse-cdtskip

提问by eold

I am debugging a large Makefile-based C project which takes 15 seconds to run "make" even if no changes to the sources are done. That means that whenever I relaunch the program, I need to wait for 15 seconds before I can even start debugging.

我正在调试一个基于 Makefile 的大型 C 项目,即使没有对源代码进行任何更改,它也需要 15 秒才能运行“make”。这意味着每当我重新启动程序时,我都需要等待 15 秒才能开始调试。

The project was imported through "Import as existing project with Makefile" and I am using gdb for debugger.

该项目是通过“使用 Makefile 作为现有项目导入”导入的,我使用 gdb 作为调试器。

I want that when I relaunch, it runs the executable which was build last. How to disable this extra step of building (i.e. running "make") before each launch/debug?

我希望当我重新启动时,它运行最后构建的可执行文件。如何在每次启动/调试之前禁用这个额外的构建步骤(即运行“make”)?

(In the rare case of actually changing the source, I am willing to do a manual build / make)

(在极少数实际更改源的情况下,我愿意进行手动构建/制作)

回答by Rix Beck

Project - Disable Autobuildoption does not always means autobuild is off. For example "Makegood" test automation plugin will trigger autobuild when Preferences - Run/Debug - launching - (General opt) Build before launchis ON. So turn it off if manual build needed.

项目 - 禁用自动构建选项并不总是意味着自动构建关闭。例如,“Makegood”测试自动化插件将在首选项 - 运行/调试 - 启动 - (常规选项)启动前构建开启时触发自动构建。因此,如果需要手动构建,请将其关闭。

回答by SuperJames

On the main tab of the debug configuration there is a radio button "Disable auto build"

在调试配置的主选项卡上有一个单选按钮“禁用自动构建”

回答by krschn

In current Eclipse builds like Oxygen.3 the option to disable automatic builds has been moved to Preferences -> Run/Debug -> Launching, and here "Build (if required) before launching" under the General Options. There doesn't seem to be a differentiation anymore between doing this for debug only, appears to apply to both regular and debug runs.

在当前的 Eclipse 构建(如 Oxygen.3)中,禁用自动构建的选项已移至“首选项”->“运行/调试”->“启动”,此处是“常规选项”下的“启动前构建(如果需要)”。仅针对调试执行此操作之间似乎不再有区别,似乎适用于常规和调试运行。

回答by Jib

You can disable the compile step if the project hasn't been modified but still want eclipse to compile it otherwise:

如果项目尚未修改但仍希望 eclipse 编译它,则可以禁用编译步骤:

Window > Preferences > C/C++ > Build > "Build configurations only when there are Eclipse resource changes..."

窗口 > 首选项 > C/C++ > 构建 > “仅当有 Eclipse 资源更改时才构建配置...”