From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26394 invoked by alias); 14 Oct 2006 16:39:17 -0000 Received: (qmail 26385 invoked by uid 22791); 14 Oct 2006 16:39:17 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 14 Oct 2006 16:39:14 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GYmXX-0004NV-8A; Sat, 14 Oct 2006 12:39:11 -0400 Date: Sat, 14 Oct 2006 16:39:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Reporting of "program no longer exists" Message-ID: <20061014163911.GA16728@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <200610142033.16596.ghost@cs.msu.su> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200610142033.16596.ghost@cs.msu.su> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00098.txt.bz2 On Sat, Oct 14, 2006 at 08:33:16PM +0400, Vladimir Prus wrote: > > Hi, > suppose a program being debugged got SIGSEGV and the user for GUI frontend > tries the "next" command. Here's what happens: > > (gdb) -exec-next > ^running > *stopped,reason="signal-received",signal-name="SIGSEGV"..... > (gdb) -exec-next > ^running > Couldn't get registers: No such process. > ^error,msg="Couldn't get registers: No such process." This is simply a bug. Try it from the CLI: (gdb) r Starting program: /bin/cat (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) Program received signal SIGSEGV, Segmentation fault. 0x00002aaaaac7f352 in __read_nocancel () from /lib/libc.so.6 (gdb) n Single stepping until exit from function __read_nocancel, which has no line number information. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) -exec-next ought to report ^running and then that the program has exited (is that ^exited?). So I'd look at where the error came from. > (1) How can frontend disable the "next" command? Checking for "SIGSEGV" is > possible, but it a bit of a hack. It's wrong. We don't know yet that the SIGSEGV will be fatal. If the application has a signal handler installed for SIGSEGV, when you continue the handler will be executed, and life will go on. -- Daniel Jacobowitz CodeSourcery