From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30572 invoked by alias); 5 Sep 2003 15:58:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30549 invoked from network); 5 Sep 2003 15:58:40 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 5 Sep 2003 15:58:40 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 19vIyo-00076T-Pe for ; Fri, 05 Sep 2003 11:58:34 -0400 Date: Fri, 05 Sep 2003 15:58:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: RFC: fix problems with errors during quitting (killed.exp) Message-ID: <20030905155833.GA27258@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <3F58B193.5090400@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F58B193.5090400@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-09/txt/msg00070.txt.bz2 On Fri, Sep 05, 2003 at 11:53:55AM -0400, J. Johnston wrote: > The following patch fixes the problem that occurs when an error happens > while > quitting. Often an error() call gets triggered and the poor user is thrown > back to the gdb command line where they try to quit again. I made an > attempt > to fix a similar problem by handling ptrace errors in quitting, however, > thread-db.c gets > into multiple precarious situations because it has to rely on libthread_db > for information. When the thread has been killed/maimed, it gets errors > when > they are not expected and quitting becomes impossible. > > My new strategy is to intercept error() calls during quitting. Basically, > a simple get/set function is set up to denote when we the user has confirmed > a quit. If we get into top.c:throw_exception() and quit has been > confirmed, it > exits the program. This handles any number of messy kill scenarios and > causes > no regressions in the current testsuite. It fixes gdb.threads/killed.exp. > I made the > functions external so other parts of gdb can register a confirmed quit if > necessary. I could > make these routines static if this feature is not needed. I chose to exit > with the > code being passed on the jump. There may be a better constant choice. > > If anyone can think of scenario that this code is not going to handle > correctly that might > not be exercised by the testsuite, please let me know. > > Tested on x86 and ia64. > > Comments? My immediate concern is, does killed.exp leave a stopped binary around? Other than that I like it. > 2003-09-04 Jeff Johnston > > * top.h (get_quit_confirmed, set_quit_confirmed): New prototypes. > * top.c (get_quit_confirmed, set_quit_confirmed): New functions. > (throw_exception): If quit confirmed, exit instead of jumping. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer