GDB 调试coredump

本文介绍了如何利用GDB调试NTP进程产生的coredump文件。首先通过`ps`命令找到NTP进程号,然后使用GDB attach到该进程并生成coredump。虽然在加载`libthread_db.so.1`时遇到问题,但仍然成功生成了core文件。通过`gdb ntpd core.1842`加载coredump,虽然没有调试符号,但能查看到内存映射和调用堆栈信息,特别是识别出问题发生在`/lib/libuClibc-0.9.33.2.so`库中。
摘要由CSDN通过智能技术生成

举例:NTP coredump

1. ps查看ntp的进程号

 1842 admin     1560 S    /usr/sbin/ntpd -n -p cn.ntp.org.cn -p edu.ntp.org.cn

2. 先gdb attach到ntp进程,然后手动生成一个coredump文件

./gdb attach 1842


dlopen failed on 'libthread_db.so.1' - File not found
GDB will not be able to debug pthreads.

GNU gdb 6.8
Copyright (C) 2008 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 "mips-linux"...
attach: No such file or directory.
Attaching to process 1842
Reading symbols from /bin/busybox...(no debugging symbols found)...done.
0x7743f5dc in ?? ()
(gdb) generate-core-file 
Saved co

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值