Ubuntu上的C ++应用程序。在安装gcc 4.8.1之后,gdb不起作用 [英] C++ app on Ubuntu. After installing gcc 4.8.1 the gdb does not work

查看:247
本文介绍了Ubuntu上的C ++应用程序。在安装gcc 4.8.1之后,gdb不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu 12.04上安装了gcc 4.8.1(我不得不添加ppa来做到这一点),现在gdb显示以下消息:

无法找到动态链接器断点功能。
GDB将无法调试共享库初始化程序
并跟踪显式加载的动态代码。不能为5个库加载共享库符号,例如, /usr/lib/x86_64-linux-gnu/libstdc++.so.6。
使用info sharedlibrary命令查看完整列表。
您是否需要设置solib-search-path或set sysroot?

我没有google,我发现这篇文章最好回答我的问题:
http://www.fayewilliams .com / 2013/01/31 / gdb-unable-to-find-dynamic-linker-breakpoint-function /

但是我还是不明白准确地做什么。有人可以帮忙吗? THX!

解决方案

我也有同样的问题,并能解决它。 $ b

我从此PPA安装了最后一个稳定版本的GCC(4.8.1)( https://launchpad.net/~ubuntu-toolchain-r/+archive/test ),并且一切都是完美的,直到我必须处理调试问题。您可以注意到,在此PPA中,工具链并未提供用于处理编译器升级的GDB更新版本。事实上,我没有发现任何PPA提供更新版本的GDB。



在我的例子中,我解决了这种情况,下载并安装了最新的GDB稳定版本(7.6 )来自其网站( http://www.sourceware.org/gdb/ )。即使我使用新的c ++ 11标准(使用-std = c ++编译的代码),此版本的GDB也能够解析这些符号并向我提供使用Gcc 4.8.1生成的二进制文件的所有必要信息请注意,手动安装这个新版本的GDB会默认安装 / emr / local / bin / gdb中的二进制文件


I installed gcc 4.8.1 on Ubuntu 12.04 (I had to add ppa to do that) now gdb displays the following message:

Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code.Could not load shared library symbols for 5 libraries, e.g. /usr/lib/x86_64-linux-gnu/libstdc++.so.6. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"?

I did google and I found this article to best answer my question: http://www.fayewilliams.com/2013/01/31/gdb-unable-to-find-dynamic-linker-breakpoint-function/

however I still do not understand what to do exactly. Could someone help. THX!

解决方案

I also had the same problem and was able to solve it.

I installed the last "stable" version of GCC (4.8.1) from this PPA (https://launchpad.net/~ubuntu-toolchain-r/+archive/test), and everything was perfect until I had to deal with the debugging issue. You can notice that in this PPA the toolchain does not provide an updated version of GDB for dealing with the compiler upgrade. In fact, I didn't found any PPA providing a newer version of GDB.

In my case I solved this situation downloading and installing the latest stable version of GDB (7.6) from its website (http://www.sourceware.org/gdb/). This version of GDB is able to resolve the symbols and give me all the necessary information of binaries generated with Gcc 4.8.1, even if I'm using the new c++11 standard (code compiled with the -std=c++11 flag).

Take into account that installing this new version of GDB manually will install, by default, the binary in /usr/local/bin/gdb.

这篇关于Ubuntu上的C ++应用程序。在安装gcc 4.8.1之后,gdb不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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