admin管理员组文章数量:1608850
参考博文:
https://blog.csdn/qq_36490086/article/details/85246107
https://e2e.ti/support/legacy_forums/embedded/linux/f/354/t/327776?gdb-gdbserver-error-shared-library-arch-not-compatible-with-target-arch-i386
本文主要是参考上述博主的文章的安装方法安装最新的的gdb9.2的步骤:
wget http://ftp.gnu/gnu/gdb/gdb-9.2.tar.xz
tar -xf gdb-9.2.tar.xz
cd gdb-9.2/
此时我们位于解压出的源码的目录,需要在当前目录下创建一个build目录以执行configure脚本,但是需要注意,configure的时候需要写上编译代码时用到的工具链 --target=arm-xxxx,如我当前使用的平台是RK3xxx,编译链是arm-rockchip-linux-gnueabihf ,步骤如下:
mkdir build
cd ./build
../configure --target=arm-rockchip-linux-gnueabihf
如果执行该配置脚本时没有指定编译工具链,则在gdb debug Core文件的时候出现如下问题:
warning: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/libnetutils.so': Shared library architecture unknown is not compatible with target architecture i386.
warning: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/libnetutils.so': Shared library architecture unknown is not compatible with target architecture i386.
Reading symbols from /xxxxxxxxxxxxxxx/libnetutils.so...
(gdb)
(gdb)
(gdb) break
No default breakpoint address now.
(gdb) backtrace
#0 <unavailable> in ?? ()
Backtrace stopped: not enough registers or memory available to unwind further
(gdb) q
然后脚本就会开始配置,终端开始打印一些log,这个脚本执行完毕后会在build目录下生成makefile:
该脚本执行完毕后,仍旧在build目录下执行make,以生成gdb执行文件
make
make完毕后在build文件夹下生成Makefile,执行sudo make install 编译出gdb
sudo make install
编译完毕后会生成gdb的二进制文件,拷贝到用户bin目录
sudo cp ./gdb/gdb /usr/local/bin/gdb
执行该句完毕后执行gdb -v查看是否安装成功,如安装成功,则有如下打印
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
本文标签: 调试工具
版权声明:本文标题:Ubuntu16.04 安装更新gdb9.2调试工具 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1728550626a1163386.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论