调试 C++ 程序时出现奇怪的 gdb 消息 [英] weird gdb message when debugging C++ program

查看:22
本文介绍了调试 C++ 程序时出现奇怪的 gdb 消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的是苹果的gdb,版本如下

I use the apple's gdb, version as follow

GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".

我不使用 Xcode IDE,因为我需要 makefile 管理的项目更方便,特别是因为我经常需要在远程机器上编译和运行程序.我最近开始使用以下 c++11 功能(在 macports 的 g++-4.6 和 4.7 上):移动构造函数、nullptr、auto 和 decltype.我最近需要对我的代码进行 d3bug,然后出现了以下奇怪的消息,而不是单步执行函数:

I don't use Xcode IDE since for my needs makefile-managed projects are more convenient, especially because I often need to compile and run programs on remote machines. I have recently started to use the following c++11 features (on g++-4.6 and 4.7 from macports): move constructors, nullptr, auto and decltype. I rencently needed to d3bug my code, and the following weird message appeared instead of stepping into a function:

Die: DW_TAG_unspecified_type (abbrev = 36, offset = 4315)
        has children: FALSE
        attributes:
                DW_AT_name (DW_FORM_string) string: "decltype(nullptr)"

自从出现此消息以来,所有后续 gdb 命令都由相同的奇怪消息回答,因此无法再进行调试.似乎与c ++ 11有关.我的问题是,你有没有遇到过这个消息,以及如何摆脱呢?

from since this message appears, all following gdb commands are answered by the same weird message, so it is not possible to debug anymore. It seems something related to c++11. My question is, have you ever encountered this message, and how to get rid of it?

提前致谢

朱利亚诺

推荐答案

您使用的 GDB 版本(Apple 版本)似乎不支持您从 macports 安装的编译器的新功能.

The version of GDB you're using (Apple's version) doesn't seem to support the newer features of the compiler you installed from macports.

错误消息是报告 GDB 不理解它在程序中遇到的一些调试信息.它所显示的调试信息是一个 C++11 特性.

The error message is reporting that GDB doesn't understand some of the debugging information it's encountered in the program. The debugging information it has shown is a C++11 feature.

解决方案是升级到较新的 GDB(可能从 macports,如果有的话),不使用 GDB 不理解的功能,或者接受您无法理解的 GDB 版本这个.

The solution is to either upgrade to a newer GDB (probably from macports if there's one there), not use the features that GDB doesn't understand, or accept that the version of GDB you have won't be able to understand this.

这篇关于调试 C++ 程序时出现奇怪的 gdb 消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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