[英]Mac OS X Yosemite C++ Eclipse error: “Error while launching command: gdb --version”
[英]Trying to Debug C++ Program on Eclipse Mars on MAC Pro Retina with OS X Yosemite Version 10.10.5
我试图在Eclipse Mars的新Mac上的C ++程序下进行调试。
我能够构建项目(生成输出文件)。
我能够以“本地C ++应用程序”运行,它不会生成输出文件,但似乎已成功完成。
但是我无法调试它说...
我在“调试配置”中尝试了其他选项,但是没有运气...
'无法使用以下命令确定GDB版本:/ usr / bin --version'...
'没有这样的调试器'
创建会话时出错无法运行程序“ gdb”:未知原因无法运行程序“ gdb”:未知原因无法运行程序“ gdb”:未知原因
无法使用以下命令确定GDB版本:/ usr / bin --version
“启动命令时出错:gdb --version”
我究竟做错了什么 ? 任何帮助将非常感激。
/*
E-Mail : ahmed.aly.tc@gmail.com
TopCoder Handle : ahmed_aly
Just For You :)
*/
#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <complex>
#include <list>
using namespace std;
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz size()
#define rep(i,m) for(int i=0;i<(int)(m);i++)
#define rep2(i,n,m) for(int i=n;i<(int)(m);i++)
#define For(it,c) for(__typeof(c.begin()) it=c.begin();it!=c.end();++it)
#define mem(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define dot(a,b) ((conj(a)*(b)).X)
#define X real()
#define Y imag()
#define length(V) (hypot((V).X,(V).Y))
#define vect(a,b) ((b)-(a))
#define cross(a,b) ((conj(a)*(b)).imag())
#define normalize(v) ((v)/length(v))
#define rotate(p,about,theta) ((p-about)*exp(point(0,theta))+about)
#define pointEqu(a,b) (comp(a.X,b.X)==0 && comp(a.Y,b.Y)==0)
typedef stringstream ss;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vector<int> > vii;
typedef long long ll;
typedef long double ld;
typedef complex<double> point;
typedef pair<point, point> segment;
typedef pair<double, point> circle;
typedef vector<point> polygon;
const int oo = (int) 1e9;
const double PI = 2 * acos(0);
const double eps = 1e-9;
inline int comp(const double &a, const double &b) {
if (fabs(a - b) < eps)
return 0;
return a > b ? 1 : -1;
}
int di[] = { 1, -1, 0, 0, 1, -1, 1, -1 };
int dj[] = { 0, 0, 1, -1, 1, -1, -1, 1 };
int diK[] = { -2, -2, -1, 1, 2, 2, 1, -1 };
int djK[] = { -1, 1, 2, 2, 1, -1, -2, -2 };
int I, J;
inline bool val(const int &i, const int &j) {
if (i < 0 || j < 0 || i >= I || j >= J)
return false;
return true;
}
int N;
int n;
int arr[2009];
//#define SMALL
#define LARGE
int main() {
freopen("a.txt", "rt", stdin);
#ifdef SMALL
freopen("A-small-attempt0.in","rt",stdin);
freopen("A-small.out","wt",stdout);
#endif
#ifdef LARGE
freopen("A-large.in","rt",stdin);
freopen("A-large.out","wt",stdout);
#endif
int c;
cin >> N;
rep2(nn,1,N+1) {
cin>>c>>n;
rep(i,n)
cin>>arr[i];
printf("Case #%d: ", nn);
rep(i,n)
rep2(j,i+1,n)
if(arr[i]+arr[j]==c){
cout<<i+1<<" "<<j+1<<endl;
goto END;
}
END:;
}
return 0;
}
苹果已经很长时间没有将gdb与它的工具一起交付了。 您可以下载并构建FSF gdb,但我不知道它在OS X上的运行情况如何。Apple为其发布的gdb版本增加了很多功能,但该功能从未出现在FSF源码库中。
苹果目前支持的调试器是lldb。 您还可以通过lldb-mi驱动程序在Eclipse中使用lldb。 例如,此处描述了这样做的方法:
https://www.codeplay.com/portal/lldb-mi-driver---part-2-setting-up-the-driver
请注意,如果您使用的是Xcode 7.x,则它现在在Xcode.app/Contents/Developer/usr/bin/lldb-mi中包含lldb-mi驱动程序,因此您不必执行上述2.1中的步骤。 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.