https://phpor.net/blog/post/846
使用rpm命名查看gdb的rpm包,主要由下面几个程序:
/usr/bin/gcore
/usr/bin/gdb
/usr/bin/gdbserver
/usr/bin/gdbtui
/usr/bin/gstack
其中:
gcore 是生成core文件用的
gdb 调试用的
gdbserver 远程调试使用
gdbtui 界面化的gdb, 同 gdb -tui
gstack 查看正在运行的进程的调用栈信息
实例:
gcore:
# gcore -o a 3236
[root@login ~]# ll a.3236
-rw-r–r– 1 root root 64691440 6? 11 20:48 a.3236
产生core的过程中进程暂停工作
========================================
# gdbserver 10.55.38.18:12345 a.out
Process a.out created; pid = 20975
Listening on port 12345
Remote debugging from host 10.55.38.14
注意: 本地需要有a.out 和a.c
========================================
# gstack 24874
#0 0x0088e7a2 in ?? () from /lib/ld-linux.so.2
#1 0x0096f68b in semop () from /lib/tls/libc.so.6
#2 0x006fdbe3 in proc_mutex_sysv_acquire (mutex=0x70ed50)
#3 0x006fe608 in apr_proc_mutex_lock (mutex=0xfffffffc)
#4 0x080829bf in child_main (child_num_arg=-4) at prefork.c:205
#5 0x08082c5e in make_child (s=0x808260c, slot=4) at prefork.c:758
#6 0x080837e5 in ap_mpm_run (_pconf=0x1, plog=0x9dfe160, s=0x2)
#7 0x08063de4 in main (argc=3, argv=0xbfe63654) at main.c:740
=========================================
gdbtui: