[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: core dumps



Cédric Lucantis writes:

> Hi,
> I'd like to know how to find which program produced a particular core dump 
> file, any idea?

,----
| (debian-unstable)jtocancipa@golem:~$ ulimit -c unlimited
| 
| (debian-unstable)jtocancipa@golem:~$ echo "
| #include <stdio.h>
| 
| int main ()
| {
|   char * foo = 0;
|   *foo = 'bar';
| 
|   return 0;
| }
| 
| " | gcc -xc -o baz -
| 
| (debian-unstable)jtocancipa@golem:~$ ./baz 
| Segmentation fault (core dumped)
| 
| (debian-unstable)jtocancipa@golem:~$ gdb -batch -c ./core | grep -i generated
| Core was generated by `./baz'.
`----

HTH,

-- 
-- Jhair



Reply to: