Redhat 5.7 安装 glibc debuginfo ,终于成功。

1) yum --enablerepo rhel-debuginfo install glibc-debuginfo

安装完之后,yum list 可以看出debuginfo 是 build 123, 而实际用的版本是 build 65 。

运行gdb 时有 CRC mistmatch , 失败。

 

2)这个路径有几个 2.5-65 的CentOS 版本, 一个一个全试过了, 都失败。

http://debuginfo.centos.org/5/x86_64/

3) 查到了怎么可以用yum安装老版本,继续挑战,终于成功

yum --showduplicates --enablerepo rhel-debuginfo list | grep glibc
yum --enablerepo rhel-debuginfo install glibc-debuginfo-2.5-65

 

安装完之后

下面的代码,puts函数的断点是一点问题都没有(printf 内部调用), 但是open函数断点的话,还是没有源程序信息。

我认为是因为open这个函数本身就是用汇编写的,所以没有c源程序。

#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(void) {
 int fd;
 fd = open("/etc/fstab",O_RDONLY);
 printf("%s\n","OK");
 close(fd);
}

 

posted @ 2016-12-12 15:21  johnsonshu  阅读(1617)  评论(0编辑  收藏  举报