From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17845 invoked by alias); 16 Mar 2006 17:31:06 -0000 Received: (qmail 17831 invoked by uid 22791); 16 Mar 2006 17:31:06 -0000 X-Spam-Check-By: sourceware.org Received: from 203.197.88.2.ILL-PUNE.static.vsnl.net.in (HELO marvin.codito.net) (203.197.88.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 16 Mar 2006 17:31:05 +0000 Received: from webmail.codito.com (localhost [127.0.0.1]) by marvin.codito.net (8.13.5/8.13.5/Debian-3) with ESMTP id k2GHPkNi001140; Thu, 16 Mar 2006 22:55:47 +0530 Received: from 61.2.59.70 (SquirrelMail authenticated user ramana.radhakrishnan) by webmail.codito.com with HTTP; Thu, 16 Mar 2006 22:55:48 +0530 (IST) Message-ID: <1106.61.2.59.70.1142529948.squirrel@webmail.codito.com> In-Reply-To: <1142529081.5372.14.camel@okra.transitives.com> References: <1142529081.5372.14.camel@okra.transitives.com> Date: Thu, 16 Mar 2006 18:54:00 -0000 Subject: Re: Fully automating GDB (aka how to make canned command strings see the exit status) From: "Ramana Radhakrishnan" To: alexjb@transitive.com Cc: gdb@sources.redhat.com Reply-To: ramana.radhakrishnan@codito.com User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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/msg00103.txt.bz2 Hi, Look at gdb scripts anyways. You could associate commands with breakpoints. Quit on hitting a breakpoint on exit ? break exit commands quit Simple : Have an external script that loops on this. In case the program hits a SEGV gdb will get it and you have the context , else gdb exits. Look at the while construct in gdb , maybe you can use that in case you can't associate commands for breakpoints from scripts. HTH cheers Ramana > 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? > > > -- > Alex, homepage: http://www.bennee.com/~alex/ > TV is chewing gum for the eyes. -- Frank Lloyd Wright > ---- Ramana Radhakrishnan GNU Tools Codito Technologies