From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11861 invoked by alias); 16 Mar 2006 17:18:33 -0000 Received: (qmail 11852 invoked by uid 22791); 16 Mar 2006 17:18:32 -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; Thu, 16 Mar 2006 17:18:31 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FJw7J-0004By-IZ; Thu, 16 Mar 2006 12:18:29 -0500 Date: Thu, 16 Mar 2006 17:25:00 -0000 From: Daniel Jacobowitz To: Alex Bennee Cc: gdb@sources.redhat.com Subject: Re: Fully automating GDB (aka how to make canned command strings see the exit status) Message-ID: <20060316171829.GA15821@nevyn.them.org> Mail-Followup-To: Alex Bennee , gdb@sources.redhat.com References: <1142529081.5372.14.camel@okra.transitives.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1142529081.5372.14.camel@okra.transitives.com> User-Agent: Mutt/1.5.8i 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-03/txt/msg00101.txt.bz2 On Thu, Mar 16, 2006 at 05:11:21PM +0000, Alex Bennee wrote: > Hi, > > I've got a program I'm trying to debug that crashes on a very > intermittent basis. I suspect the core dumps I'm getting are incomplete > so I would like to try and catch the the crash live in gdb. > > I figure a canned script to run the program is the answer. However how > do I tell if the program has exited successfully (in which case I can > run again) to hitting the SEG and staying put for when I come back in > the morning? There's lots of ways you can do this. There's nothing in the GDB command line scripting language that will work, but you can drive GDB using something like "expect" instead; have the expect script stop when it sees a SIGSEGV in the output. -- Daniel Jacobowitz CodeSourcery