Re: renaming core dumps

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Thu, 22 Feb 1996 10:58:24 +0100


On 21 Feb 96 at 12:31, Johan Myr=E9en wrote:

> On Tue, 20 Feb 1996, Marty Leisner wrote:
>=20
> > This has always been frustrating...freebsd has core dumps of the
> > form core.command which is much preferable over "core".

Originally Marty complained about core files being overwritten when=20
gdb dumps core. First of all gdb also acepts core files that are=20
named differently; therefore if you have an intersting core dump,=20
just rename it. Otherwise an automatic core-cleaner could erase it=20
before you have fully evaluated the problem.

>=20
> This has been discussed a number of times on this list. IMHO, if we w=
ant
> to tack on the command name to the core file, the format should be
> command.core, not core.command. That FreeBSD does it the other way is=
no
> reason for us to do so.
>=20
> By the way, is it safe to assume pid <=3D 99999?
>=20
> > This is a fix to generate
> >
> > core.<name>.<pid>
> ...
> > + char corefile[6+sizeof(current->comm) + 6];
> ...
> > + sprintf(corefile, "core.%s.%d", current->comm, current->pid);
>=20

The plain name "core" has the advantage that it is so common in UN*X.=20
It does not mean that the name is perfect, but at least the behaviour=20
should be configurable within "make config".

Despite of that gdb catches a lot of signals. Maybe someone could add=20
code to make gdb dump under a different name (being not sure if this=20
is possibe).

> --
> Johan Myreen
> jem@vistacom.fi
Ulrich