1. $bash ,我的机器默认的shell时csh,无法使用export命令。
2.
1 bash-4.1$ pwd 2 /tmp/chao/gdb-python-show
3.下载gdb: wget http://mirrors.kernel.org/sourceware/gdb/releases/gdb-7.9.tar.gz
得到:
1 bash-4.1$ ls 2 gdb-7.9.tar.gz
4.解压: bash-4.1$ tar -zxvf gdb-7.9.tar.gz
5.进入解压文件:
1 bash-4.1$ pwd 2 /tmp/chao/gdb-python-show/gdb-7.9
6.找到python可执行程序的位置:
1 bash-4.1$ which python 2 /export/opt/Anaconda-1.9/bin/python
7.设置环境变量: LDFLAGS : export LDFLAGS="-Wl,-rpath,/export/opt/Anaconda-1.9/lib -L/export/opt/Anaconda-1.9/lib" , 其中 /export/opt/Anaconda-1.9/lib 表示的是python安装目录下的lib文件夹,若为Anaconda,则使用Anaconda/lib。
8. ./configure --prefix="/tmp/chao/gdb-python-show/gdb-7.9/gdb-python" --with-python="/export/opt/Anaconda-1.9/bin/" , --prefix= 设置gdb的安装路径, --with-python= 设置python可执行程序所在的全路径。
9. make ,8个i7-4790的linux机器,共用时3分17秒。
10. make install ,make与make install后,最后都显示
1 make[1]: Nothing to be done for `install-target'. 2 make[1]: Leaving directory `/tmp/chao/gdb-python-show/gdb-7.9'
11.安装完成,可以正常使用。
bash-4.1$ ls bfd config.log configure COPYING.LIB gdb libdecnumber lt~obsolete.m4 Makefile missing readline symlink-tree ChangeLog config-ml.in configure.ac cpu gdb-python libiberty ltoptions.m4 Makefile.def mkdep README texinfo compile config.rpath COPYING depcomp include libtool.m4 ltsugar.m4 Makefile.in mkinstalldirs README-maintainer-mode ylwrap config config.status COPYING3 djunpack.bat install-sh ltgcc.m4 ltversion.m4 Makefile.tpl move-if-change serdep.tmp config.guess config.sub COPYING3.LIB etc intl ltmain.sh MAINTAINERS md5.sum opcodes sim bash-4.1$ cd gdb-python/ bash-4.1$ ls bin include lib share bash-4.1$ cd bin/ bash-4.1$ ls gcore gdb gdbserver bash-4.1$ ./g gcore gdb gdbserver bash-4.1$ ./gdb GNU gdb (GDB) 7.9 Copyright (C) 2015 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. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb)
12.在QtCreator中测试: