GDB和Valgrind上的Eclipse Luna错误消息无法作为本地C / C ++应用程序调试或配置文件C ++程序 [英] Eclipse Luna error messages on GDB and Valgrind, unable to Debug or Profile C++ program as Local C/C++ Application

查看:671
本文介绍了GDB和Valgrind上的Eclipse Luna错误消息无法作为本地C / C ++应用程序调试或配置文件C ++程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几天前为64位Mac OS X下载了Eclipse Luna。希望将Eclipse用于指定为学生作业的小型C ++程序。将其设置为Eclipse C ++项目。



我将选定的配置构建为Debug,并将其作为本地C / C ++应用程序运行。都好。我的C ++程序运行并输出显示在Console窗口中,完全按照我的需要。



当我尝试调试为本地C / C ++应用程序时,消息窗口命令错误:gdb --version。无法运行程序'gdb':未知原因因此,我无法在Debug透视图中启动我的程序,并逐步执行,使用断点,检查变量赋值等。



当我尝试 Profile作为本地C / C ++应用程序时,有一个消息窗口无法确定Valgrind的版本。 code>因此我无法执行自动内存泄漏检测。我需要使用Eclipse> Help> Install New以其他方式完成Eclipse安装软件选项?我是否需要在我的Mac上执行一些额外的安装(它们在Eclipse框架之外)?我没有看到这里缺少什么,就我的软件安装而言。



任何帮助,非常感谢。!!

属性MyLittleProject,工具链编辑器
当前工具链:MacOSX GCC
当前生成器:Gnu Make生成器
使用的工具
MacOS XC链接器
MacOS X C ++ Linker
GCC汇编程序
GCC Archiver
GCC C ++编译程序
GCC C编译程序



关于ECLIPSE
Eclipse IDE对于C / C ++开发人员
版本:Luna Release(4.4.0)
Build ID:20140612-0600

安装细节>>安装的软件
用于C / C ++开发人员的Eclipse IDE
EPP CPP特性
C / C ++ Autotools支持
C / C ++开发工具
C / C ++通用GDB支持
。 。 。
C / C ++ GCC交叉编译器支持
。 。 。
CDT独立调试器支持
。 。 。
GDB Tracepoint分析
。 。 。
Valgrind工具集成
Profile框架

解决方案

Eclipse既不能找到 gdb 也不会在您的计算机上使用 valgrind 。你必须手动安装这些。您可以在安装细节>>安装的软件中看到安装了这两个程序的接口,但程序本身缺失。



在Mac上,您可能需要使用 LLDB 而不是 gdb

如果您坚持使用这两者,您必须先安装它们。我对MacOS并不熟悉,但也许下面的链接被证明是有用的:



修正:
valgrind插件在特定路径上搜索二进制文件。如果它不起作用,您需要像这样(从官方文档,注意有一个错误会在下面解决) :

  ln -s $(which valgrind)/ usr / bin / valgrind 


I downloaded Eclipse Luna for 64-bit Mac OS X just a few days ago. Would like to use Eclipse for a small C++ program assigned as student homework. Set this up as an Eclipse C++ project.

I built the selected configuration as Debug and run it as Local C/C++ Application. All good. My C++ program runs and output appears in Console window exactly as I want it.

When I attempt Debug as Local C/C++ Application there is a message window Error with command: gdb --version. Cannot run program 'gdb': Unknown reason. So I am unable to launch my program in the Debug perspective and step-execute line by line, use breakpoints, examine variable assignments, etc.

When I attempt Profile as Local C/C++ Application, there is a message window Couldn't determine version of Valgrind. So I am unable to perform automated memory leak detection.

Do I need to complete my Eclipse installation in some additional way using Eclipse > Help > Install New Software option? Do I need to perform some additional installation(s) on my Mac that are outside of the Eclipse framework? I do not see what is missing here, as far as my software installations.

Any assistance, much appreciated..!

Properties for MyLittleProject, Tool Chain Editor Current toolchain: MacOSX GCC Current builder: Gnu Make Builder Used tools MacOS X C Linker MacOS X C++ Linker GCC Assembler GCC Archiver GCC C++ Compiler GCC C Compiler

ABOUT ECLIPSE Eclipse IDE for C/C++ Developers Version: Luna Release (4.4.0) Build id: 20140612-0600

INSTALLATION DETAILS>>INSTALLED SOFTWARE Eclipse IDE for C/C++ Developers EPP CPP Feature C/C++ Autotools support C/C++ Development Tools C/C++ Common GDB Support . . . C/C++ GCC Cross Compiler Support . . . CDT Standalone Debugger Support . . . GDB Tracepoint Analysis . . . Valgrind Tools Integration Profile Framework

解决方案

Eclipse can find neither gdb nor valgrind on your computer. You have to install these manually. You see at INSTALLATION DETAILS>>INSTALLED SOFTWARE that the interfaces to these two programs are installed, yet the programs themselves are missing.

On Mac, you may want to use LLDB instead of gdb.

If you insist on using the two, you have to install them first. I am not familiar with MacOS, but maybe the following links prove to be usefull:

Amendment: The valgrind plugin searches at a specific path for the binary. If it does not work, you need to add a symbolic link to the actual binary like so (from the offical documentation, note that there is a mistake which is corrected below):

ln -s $(which valgrind) /usr/bin/valgrind 

这篇关于GDB和Valgrind上的Eclipse Luna错误消息无法作为本地C / C ++应用程序调试或配置文件C ++程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆