Eclipse CDT无法在Mac上使用gdb进行调试

编程入门 行业动态 更新时间:2024-10-08 22:12:25
本文介绍了Eclipse CDT无法在Mac上使用gdb进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个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 --version By expanding the Details, it gives: Error with command: gdb --version Cannot run program "gdb": Unknown reason

I 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.1

Added: 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进行调试

本文发布于:2023-11-24 14:18:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:CDT   Eclipse   gdb   Mac

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!