本文介绍了在Mac上使用Eclipse Galileo来调试C ++的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Eclipse Galileo在我的MacBook Pro上调试C ++代码,运行(豹)。这是我第一次尝试这个。我有一个复杂的C ++程序,我想调试,但为了测试的东西,我只是试图调试并逐步执行以下:

  #include< iostream> 
使用命名空间std;

int main()
{
int x = 0;
cout<<< x< ENDL;

x = 54;
cout<<< x< ENDL;

return 0;
}

我点击了调试图标,告诉它使用(DSF)创建进程启动程序,并开始逐步执​​行代码。我想能够监视x的值,所以我打开了变量窗口并观看。最初,这是4096 - 可能是一些垃圾价值。一旦我打到下一行,它显示了该值,它现在显示以下错误:

 无法执行MI命令:
-var-update 1 var1
调试器后端的错误消息:
未找到变量对象

我似乎无法弄清楚这一点,还是围绕着它。而且几个谷歌搜索变得骨干,甚至没有提示。






解决方案:如下所示,使用标准创建进程启动器而不是GDB创建进程启动程序。 (这实际上是一个解决方法,而不是一个真正的解决方案,但它至少为我们两个人工作。)

解决方案

在我的体验gdb / dsf启动器依然是无法使用的。我不能得到它来显示变量,它似乎还是非常错误。



你尝试过标准创建进程启动器吗?对我来说这样做很好。


I am trying to debug C++ code using Eclipse Galileo on my MacBook Pro running Mac OS X v10.5 (Leopard). It's my first time trying this. I have a complicated C++ program I'd like to debug, but to test things out, I just tried to debug and step through the following:

#include <iostream>
using namespace std;

int main()
{
  int x = 0;
  cout << x << endl;

  x = 54;
  cout << x << endl;

  return 0;
}

I clicked the debug icon, told it to use GDB (DSF) Create Process Launcher and started to step through the code. I wanted to be able to monitor the value of x, so I opened up the Variables window and watched. Initially, it was 4096 - presumably some garbage value. As soon as I hit the next line, where it had shown the value, it now shows the following error:

Failed to execute MI command:
-var-update 1 var1
Error message from debugger back end:
Variable object not found

I can't seem to figure this out or get around it. And a few Google searches turned up bone dry without even the hint of a lead.


Solution: As drhirsch pointed out below, use the Standard Create Process Launcher instead of the GDB Create Process Launcher. (This is actually a workaround and not a true solution, but it worked for at least two of us.)

解决方案

In my experience the gdb/dsf launcher is still quite unusable. I can't get it to show variables too, it seems still very buggy.

Did you try the Standard Create Process Launcher? For me this works fine.

这篇关于在Mac上使用Eclipse Galileo来调试C ++的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 06:32