首页 > 代码库 > 确定core文件是由哪个文件产生的方法

确定core文件是由哪个文件产生的方法

1.用gdb打开core文件来确定。如下例子:

[xuzhina@localhost ~]$ ls
asm.list    Desktop    Downloads  Pictures  Templates  vmtoolsd
core.22625  Documents  Music      Public    Videos     vmtoolsd.tar.gz
[xuzhina@localhost ~]$ ls core.22625 
core.22625
[xuzhina@localhost ~]$ gdb -c core.22625 
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
[New LWP 22625]
[New LWP 22680]
Core was generated by `/usr/lib/vmware-tools/sbin64/vmtoolsd -n vmusr --blockFd 3'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000000000 in ?? ()
(gdb) 

2.用file命令来确定,如下例子:

[xuzhina@localhost ~]$ ls -l core.22625 
-rw-------. 1 xuzhina xuzhina 16257024 Sep  5 23:50 core.22625
[xuzhina@localhost ~]$ file core.22625 
core.22625: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from '/usr/lib/vmware-tools/sbin64/vmtoolsd -n vmusr --blockFd 3'



确定core文件是由哪个文件产生的方法