gcore之后,如何查看栈信息

这里假设gcore文件a已经存在,如果不存在可以使用命令:gcore pid,生成一个,下面简要描述过程:

1.gdb binary a

2.gdb中设置log文件的位置,同时打开log;
set logging file /tmp/test.txt
set logging on

3.使用 thread apply all bt输出所有的堆栈
Thread 2 (Thread 0x41ec5940 (LWP 7312)):
0 0x00002b6370d241c0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
1 0x00002aaab3bbf229 in ?? () from /usr/lib64/libnspr4.so
2 0x00002aaab3bbfe69 in PR_WaitCondVar () from /usr/lib64/libnspr4.so
3 0x00002aaab3bc51bc in PR_Sleep () from /usr/lib64/libnspr4.so
4 0x00002aaab302750e in ?? () from /usr/lib64/libssl3.so
5 0x00002aaab3bc55cd in ?? () from /usr/lib64/libnspr4.so
6 0x00002b6370d1f77d in start_thread (arg=) at pthread_create.c:301
7 0x00002b637120d9ad in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x2b63731b4360 (LWP 4718)):
0 0x00002b6371206b42 in select () from /lib64/libc.so.6
1 0x00002b6370b10d25 in apr_sleep () from /usr/lib64/libapr-1.so.0
2 0x00002b636f242315 in ap_wait_or_timeout ()
3 0x00002b636f24b79e in ap_mpm_run ()
4 0x00002b636f225fd8 in main ()

接下来就可以在/tmp/test.txt文件中进行信息查找了

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值