Re: [patch] Forbid run with a core file loaded

Mark Kettenis
2010-05-21T15:31:47Z

> Date: Fri, 21 May 2010 08:04:28 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> > > there is already a protection against loading a core file when a
> > > program is running.
> >
> > That makes sense. But what you are suggesting doesn't.
> >
> > I often start gdb and load a core file to investigate a problem. Then
> > I set a breakpoint at some point before the crash and run the program
> > again. This used to work just fine.
>
> There might have been a poor choice of words in the subject - Based on
> the patch, Jan is not proposing to actually forbid that operation.
> Rather, he's suggesting we add a confirmation query before actually
> restarting the inferior. Would you agree to such a change?

I'd think that would be pretty pointless. You don't really lose state
if you use the "run" command. You can easily get back to looking at
the core file by reloading it using the "core" command.

In general these "Are you sure?" type questions are un-Unixy and
rather annoying in my opinion. They make sense if the user is about
to take an action that is going to lose state (such as loading a core
file while a program is running), but I think we shouldn't add them in
this case.