我正在关注 Eclipse Photon 文档中的 C++ 调试教程部分 ( https://help.eclipse.org/photon/index.jsp )。我已按照创建第一个 C++ 项目的所有说明进行操作,并且在“调试项目”部分。我的问题是,在我创建调试透视图并点击“调试”按钮后,调试器永远不会在我设置的断点处停止。在调试窗口中它只是说,程序的循环甚至根本不产生任何输出。如果您正常运行程序,则循环将打印到控制台,但在调试方面没有任何反应。
我尝试删除我的调试透视图并创建一个新透视图,但我遇到了同样的问题。我已经上传了我的调试配置的截图。
https://imgur.com/a/MXYHxJl
https://imgur.com/a/eEU47Ht
https://imgur.com/a/koOf08x
#include <iostream>
using namespace std;
int main () {
// Say HelloWorld five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;
char input = 'i';
cout << "To exit, press 'm' then the 'Enter' key." << endl;
cin >> input;
while(input != 'm') {
cout << "You just entered '" << input << "'. "
<< "You need to enter 'm' to exit." << endl;
cin >> input;
}
cout << "Thank you. Exiting." << endl;
return 0;
}