是否有可能得到正在运行的进程和它的符号表的核心转储?

是否有可能得到GDB或使用其他工具来创build正在运行的进程的核心转储,它是符号表? 如果有一种方法可以在不终止stream程的情况下做到这一点,那就太好了。

如果这是可能的,你会使用什么命令? (我试图在Linux上做这个)

 $ gdb --pid = 26426
 (gdb)gcore
保存的核心文件core.26426
 (gdb)分离

或者运行gcore $(pidof processname)

这有利于(在运行gdb并向CLI发出命令),在最短的时间内连接和分离。

注意:以下方法将终止正在运行的进程并且也需要符号。

您可以将以下信号之一(action = core)发送到正在运行的进程:
来自: http : //man7.org/linux/man-pages/man7/signal.7.html

  Signal Value Action Comment ────────────────────────────────────────────────────────────────────── SIGHUP 1 Term Hangup detected on controlling terminal or death of controlling process SIGINT 2 Term Interrupt from keyboard SIGQUIT 3 Core Quit from keyboard SIGILL 4 Core Illegal Instruction SIGABRT 6 Core Abort signal from abort(3) SIGFPE 8 Core Floating point exception SIGKILL 9 Term Kill signal SIGSEGV 11 Core Invalid memory reference SIGPIPE 13 Term Broken pipe: write to pipe with no readers SIGALRM 14 Term Timer signal from alarm(2) SIGTERM 15 Term Termination signal SIGUSR1 30,10,16 Term User-defined signal 1 SIGUSR2 31,12,17 Term User-defined signal 2 SIGCHLD 20,17,18 Ign Child stopped or terminated SIGCONT 19,18,25 Cont Continue if stopped SIGSTOP 17,19,23 Stop Stop process SIGTSTP 18,20,24 Stop Stop typed at terminal SIGTTIN 21,21,26 Stop Terminal input for background process SIGTTOU 22,22,27 Stop Terminal output for background process 

像这样:
kill <signal> <pid>

一旦你有核心,你可以在符号文件中打开gdb。

您可以在gdb中使用generate-core-file命令生成正在运行的进程的核心转储。