近期使用gdb调试分析mysql 8.0.18源码,发现gdb版本过低,无法有效跟踪mysql 8.0.18源码。另外,当时为了编译安装mysql 8.0.18源码,升级了默认的gcc版本到gcc 8.3.1。由此可见,gcc与gdb版本之间兼容依赖关系。
微信公众号
(欢迎大家关注,每天会在微信公众号发布其它的数据库文章)

微信

(收费20元已共享到百度云盘便于同学们获取)


前提条件
gdb 8.3.1安装介质
解压 gdb 8.3.1安装介质
执行configure
执行make
执行make install
验证gdb 8.3.1
已安装 textinfo-6.6.tar.gz
http://ftp.gnu.org/gnu/gdb/
[root@mysql8018 gdb_dir]# tar zxvf gdb-8.3.1.tar.gz
[root@mysql8018 local]# cd /gdb_dir/
[root@mysql8018 gdb_dir]# ll
总用量 37244
drwxr-xr-x. 17 root root 4096 12月 3 22:44 gdb-8.3.1
-rw-r--r--. 1 root root 38130999 12月 3 22:28 gdb-8.3.1.tar.gz
[root@mysql8018 gdb-8.3.1]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-1.1.0/lib:/usr/local/mpfr-3.1.2/lib:/usr/local/gmp-5.1.3/lib
[root@mysql8018 gdb-8.3.1]#
[root@mysql8018 gdb-8.3.1]# locate textinfo|grep -i --color /bin
/textinfo_dir/texinfo-6.6/tp/maintain/lib/libintl-perl/sample/simplecal/bin
/textinfo_dir/texinfo-6.6/tp/maintain/lib/libintl-perl/sample/simplecal/bin/simplecal.pl
/usr/local/textinfo-6.6/bin
[root@mysql8018 gdb-8.3.1]# export PATH=$PATH:/usr/local/textinfo-6.6/bin
[root@mysql8018 gdb-8.3.1]#
[root@mysql8018 gdb-8.3.1]# ./configure --prefix=/usr/local/gdb-8.3.1
[root@mysql8018 gdb-8.3.1]# make
[root@mysql8018 gdb-8.3.1]# make install
[root@mysql8018 ~]# /usr/local/gdb-8.3.1/bin/gdb --version
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/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.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-2666802/ ,如需转载,请注明出处,否则将追究法律责任。