From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19907 invoked by alias); 21 May 2010 15:31:47 -0000 Received: (qmail 19899 invoked by uid 22791); 21 May 2010 15:31:47 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 May 2010 15:31:43 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o4LFV8dP008490; Fri, 21 May 2010 17:31:08 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o4LFV6cF022228; Fri, 21 May 2010 17:31:06 +0200 (CEST) Date: Fri, 21 May 2010 15:40:00 -0000 Message-Id: <201005211531.o4LFV6cF022228@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: jan.kratochvil@redhat.com, gdb-patches@sourceware.org In-reply-to: <20100521150428.GQ3019@adacore.com> (message from Joel Brobecker on Fri, 21 May 2010 08:04:28 -0700) Subject: Re: [patch] Forbid run with a core file loaded References: <20100521134718.GA17157@host0.dyn.jankratochvil.net> <201005211447.o4LEl7tQ019880@glazunov.sibelius.xs4all.nl> <20100521150428.GQ3019@adacore.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00492.txt.bz2 > Date: Fri, 21 May 2010 08:04:28 -0700 > From: Joel Brobecker > > > > 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.