GDB是一款bug调试工具,下载地址为 安装的平台为ppc64 ppc64 ppc64 GNU/Linux,系统为Red Hat Enterprise Linux Server release 5.1 (Tikanga); 之前安装正常,但是使用后,发现不能识别core文件,看了README之后,发现首先需要让GDB识别机器。 解压gdb-6.5.tar.gz,cd gdb-6.5,首先建议查看下readme的内容 README for GNU development tools This directory contains various GNU compilers, assemblers, linkers, If you are receiving this as part of a GDB release, see the file gdb/README. It is now possible to automatically configure and build a variety of ./configure To install them (by default in /usr/local/bin, /usr/local/lib, etc), (If the configure script can't determine your type of computer, give it If you have more than one compiler on your system, it is often best to CC=gcc ./configure A similar example using csh: setenv CC gcc Much of the code and documentation enclosed is copyright by REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info 现在查看下gdb/configure.tgt内容,查找你的机器对应的target选项,例如cpu,系统的标识 我这台服务器是ppc64的,安装了redhatLinux,所以对应powerpc64-*-linux*) gdb_target=linux这条。 现在进行编译前的准备,回到gdb-6.5的目录 运行./config.sub powerpc64-redhat-linux,如果一切正常的话,会返回下面这样的结果 powerpc64-redhat-linux-gnu 现在,可以进行安装步骤了。 首先,编译 ./configure ppc64-redhat-linux 不过官方推荐的编译器是gcc,所以上面的命令改成这样 CC=gcc ./configure ppc64-redhat-linux 接下来,就是很make和make install了,一切正常的话,那么GDB就安装完成了。 GDB的使用,命令 gdb 参数 core文件 针对我的程序,那么是这样 gdb owccm core.XXXXX |