> 问答

LINUX下GDB的安装

人阅读 2024-10-17 06:06:19Linux
广告 X
欧意最新版本

欧意最新版本

欧意最新版本app是一款安全、稳定、可靠的数字货币交易平台。

APP下载  官网地址

    GDB是一款bug调试工具,下载地址为https://ftp.gnu.org/gnu/gdb/安装的平台为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 toolsThis directory contains various GNU compilers, assemblers, linkers,debuggers, etc., plus their support routines, definitions, and documentation.

    If you are receiving this as part of a GDB release, see the file gdb/README.

    If with a binutils release, see binutils/README; if with a libg release,see libg /README, etc. That'll give you info about thispackage -- supported targets, how to use it, how to report bugs, etc.

    It is now possible to automatically configure and build a variety oftools with one command. To build all of the tools contained herein,run the ``configure'' script here, e.g.:

    ./configuremakeTo install them (by default in /usr/local/bin, /usr/local/lib, etc),then do:

    make install(If the configure script can't determine your type of computer, give itthe name as an argument, for instance ``./configure sun4''. You canuse the script ``config.sub'' to test whether a name is recognized; ifit is, config.sub translates it to a triplet specifying CPU, vendor,and OS.)If you have more than one compiler on your system, it is often best toexplicitly set CC in the environment before running configure, and toalso set CC when running make. For example (assuming sh/bash/ksh):

    CC=gcc ./configuremakeA similar example using csh:

    setenv CC gcc./configuremakeMuch of the code and documentation enclosed is copyright bythe Free Software Foundation, Inc. See the file COPYING orCOPYING.LIB in the various directories, for a description of theGNU General Public License terms under which you can copy the files.

    REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for infoon where and how to report problems.

    现在查看下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

关键词标签:LINUX

LOT物联网

iot产品 iot技术 iot应用 iot工程

Powered By LOT物联网  闽ICP备2024036174号-1

联系邮箱:support1012@126.com