From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17063 invoked by alias); 14 Nov 2006 17:00:58 -0000 Received: (qmail 17051 invoked by uid 22791); 14 Nov 2006 17:00:57 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-02.spheriq.net (HELO lon-del-02.spheriq.net) (195.46.50.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Nov 2006 17:00:49 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-02.spheriq.net with ESMTP id kAEH0lRb021040 for ; Tue, 14 Nov 2006 17:00:47 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-03.spheriq.net with ESMTP id kAEH0kJQ005743 for ; Tue, 14 Nov 2006 17:00:46 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id kAEH0jsZ001899 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 14 Nov 2006 17:00:45 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9EF7ADA42; Tue, 14 Nov 2006 17:00:40 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3525F474C9; Tue, 14 Nov 2006 17:00:40 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CIF40829 (AUTH stubbsa); Tue, 14 Nov 2006 17:00:38 GMT Message-ID: <4559F636.6030605@st.com> Date: Tue, 14 Nov 2006 17:00:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Rob Quill Cc: gdb@sourceware.org Subject: Re: GDB Script predefined variables References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-11/txt/msg00088.txt.bz2 Rob Quill wrote: > I was wondering what predefined variables, if any, there are in GDB, > that can be used when writing a GDB script. Specifically, I want the > script to be able to test when the program has finished executing, but > any other predefined variables would also be useful, if there is a > list somewhere or someone knows them all. To show all GDB variables, predefined or otherwise: (gdb) show conv For your specific needs, there is a variable '$_exitcode' defined after the program exits (it does not exist before). If you try to test a GDB convenience variable before it exists, GDB will create it for you, but it does not initialise it (the value will be 'void'). I'm not sure it is an official feature, but the following comparison works: if $_exitcode == (void)0 echo program not finished\n end The value of the void is not significant - it is just to make the expression valid. HTH Andrew