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

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

问题描述

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

  GNU gdb 6.3.50-20050815(Apple版本gdb-1344) (Fri Jul 3 01:19:56 UTC 2009)
版权所有2004 Free Software Foundation,Inc.
GDB是免费软件,涵盖在GNU通用公共许可证下,您是
欢迎使用在某些条件下更改和/或分发它的副本。
键入显示复制以查看条件。
GDB绝对没有保修。有关详细信息,请键入显示保修。
此GDB配置为x86_64-apple-darwin。

我不使用Xcode IDE,因为我的需求makefile管理的项目更方便,特别是因为我经常需要在远程机器上编译和运行程序。我最近开始使用以下c ++ 11功能(在g ++ - 4.6和4.7从macports):move constructors,nullptr,auto和decltype。我急需d3bug我的代码,并出现以下古怪的消息,而不是步入一个函数:

  Die:DW_TAG_unspecified_type = 36,offset = 4315)
有子代:FALSE
属性:
DW_AT_name(DW_FORM_string)string:decltype(nullptr)
pre>

自从此消息出现以来,所有以下gdb命令都由同一个奇怪的消息回答,因此不可能再调试。它似乎与c ++ 11有关。我的问题是,你有没有遇到这个消息,如何摆脱



提前感谢



Giuliano

解决方案

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



错误消息报告GDB不能理解程序中遇到的一些调试信息。它显示的调试信息显然是C ++ 11相关。



解决方案是升级到更新的GDB(可能从macports,如果有)使用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".

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)"

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?

Thanks in advance

Giuliano

解决方案

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.

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 clearly C++11 related.

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.

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

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