This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Running testsuite with /proc/sys/kernel/core_uses_pid set, avoiding leaving core dump files behind


On Thursday 08 September 2011 14:08:33, Jan Kratochvil wrote:
> On Wed, 07 Sep 2011 18:18:38 +0200, Pedro Alves wrote:
> > I'm fixing this by making the tests look for core.PID as well.
> 
> Do you have anything against using lib/gdb.exp core_find instead?

Nothing personal, no. :-)  core_find is meant for a different scenario.
core_find runs a program that dumps core by itself, and such produced core
file is then used on subsequent gdb tests, as the inferior to debug.

The annota*.exp tests run a program that doesn't normally crash,
debug it normally (do some next/steps, etc., with annotations enabled),
and then force a signal on the inferior we know is not t handled
("(gdb) signal SIGTRAP").  The purpose of the test is not to generate the
core dump per se, but to check the annotations around sending a
signal that is not handled by the program.  The core itself it totally
uninteresting, and is a byproduct.  If you were investigating a annota*.exp
fail, you'd not need the core dump for anything.

On light of that, do you agree?

> > Anyway, I don't supposed there are any objections to this
> > patch?
> 
> While I agree that leaving a bunch of "anonymous" core files is definitely bad
> the advantage of lib/gdb.exp core_find is that it keeps the intermediate files
> for later problems investigations - identifiable with names "$binfile.core".

Right, that's useful when we have tests that used the core as inferior, so
keeping it around is useful, as that way you still have the exact same
inferior handy to be able to reproduce the crash.  But that's not the case of
these tests.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]