本文介绍了Eclipse CDT无法在Mac上使用gdb进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个C ++项目导入Eclipse CDT。我可以使用Makefile和参数设置来构建和运行项目。但是,当我尝试添加一个调试点并运行debug as local c / c ++ application时,它会给我一个错误启动projectName遇到问题。使用命令gdb --version 通过展开详细信息,它给出:命令错误:gdb --version 无法运行程序gdb :未知原因 我以前由Macports安装了gdb。如果输入命令 ggdb ,则返回版本信息。如果我键入哪个ggdb ,它会提供 / opt / local / bin / ggdb 。我尝试添加PATH来调试配置 - >环境变量,并给它的路径值,但它没有工作。请问如何设置路径并链接路径?而且变量名称应该是什么。 我的机器上的gdb版本是GNU gdb(GDB)7.7.1 添加:我查找哪个ggdb 并使用提供的链接更改gdb调试器以浏览到该路径。但它没有工作。 谢谢。 解决方案看起来Eclipse正在使用默认的 gdb 您从Macports安装 ggdb 之前的系统。此链接显示如何更改调试器设置,将其更改为 ggdb ,这是Macport使用的名称。 安装 ggdb 从Macports你将不得不使用证书签名,所以它将被允许控制其他进程,看看认证GDB这里。创建证书后,请确保在签名时选择正确的名称: $ codesign -s gdb-cert $(which ggdb )///'ggdb' I have a C++ project imported to Eclipse CDT. I can build and run the project using Makefile and argument settings. However, when I tried to add a debug point and run "debug as local c/c++ application", it throws me an error of "Launching projectName" has encountered a problem. Error with command gdb --versionBy expanding the Details, it gives: Error with command: gdb --versionCannot run program "gdb": Unknown reasonI installed the gdb by Macports before. If I enter command ggdb it returns the version info. If I type which ggdb, it gives /opt/local/bin/ggdb. I tried to add "PATH" to debug configuration -> environment variables and give the path value to it, but it did not work. How should I set the path and link the path please? And what should the variable name be.The gdb version on my machine is GNU gdb (GDB) 7.7.1Added: I looked up which ggdb and used the link James provided to change gdb debugger to browse to that path. But it did not work still.Thanks. 解决方案 It looks like Eclipse is using the default gdb that was on the system before you installed ggdb from macports. This link shows how to change the debugger settings, change it to ggdb which is the name Macport uses.After installing ggdb from Macports you will have to sign it with a certificate so it will be allowed to control other processes, take a look at "Certifying GDB" here. After creating the certificate, make sure you select the correct name when signing:$ codesign -s gdb-cert $(which ggdb) /// 'ggdb' 这篇关于Eclipse CDT无法在Mac上使用gdb进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-14 16:50