From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11603 invoked by alias); 28 Oct 2005 14:01:40 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11574 invoked by uid 22791); 28 Oct 2005 14:01:37 -0000 Received: from lon-del-02.spheriq.net (HELO lon-del-02.spheriq.net) (195.46.50.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 28 Oct 2005 14:01:37 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-02.spheriq.net with ESMTP id j9SE1Q7D018141 for ; Fri, 28 Oct 2005 14:01:26 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-01.spheriq.net with ESMTP id j9SE1Pvx023343 for ; Fri, 28 Oct 2005 14:01:26 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 j9SE1Knm009898 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 28 Oct 2005 14:01:24 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 4C40EDA7A; Fri, 28 Oct 2005 13:58:48 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 54FFA4743D; Fri, 28 Oct 2005 14:01:38 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D343F75999; Fri, 28 Oct 2005 14:01:37 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4DA204743D; Fri, 28 Oct 2005 14:01:37 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CEP00301 (AUTH "andrew stubbs"); Fri, 28 Oct 2005 14:58:46 +0100 (BST) Message-ID: <43622E2A.9050600@st.com> Date: Fri, 28 Oct 2005 14:01:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb@sources.redhat.com Subject: Re: RFC: GDB as a loader 2/3: return child result References: <4354DC55.4090706@st.com> <436205A6.9010403@st.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030907090902030803080106" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 X-SW-Source: 2005-10/txt/msg00186.txt.bz2 This is a multi-part message in MIME format. --------------030907090902030803080106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 604 Eli Zaretskii wrote: > The "error occurs" part is not clear enough, IMO. Could you please > state more clearly what kinds of error could cause this ``unless'' > clause to kick in? Also, if such an error does occur, what will GDB > return as its exit status in that case? > > I think we should spell out all this information, since this option is > meant to be used by people who write shell scripts that invoke GDB in > batch mode. If I'd need to write such a script, I'd wish to know > exactly what kinds of exit codes I will see and under what > circumstances. Ok. How about the attached? Andrew --------------030907090902030803080106 Content-Type: text/plain; name="return-result-docs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="return-result-docs.patch" Content-length: 1396 2005-10-28 Andrew Stubbs * gdb.texinfo (Choosing modes): Add --return-child-result. Index: src/gdb/doc/gdb.texinfo =================================================================== --- src.orig/gdb/doc/gdb.texinfo 2005-10-28 14:04:49.000000000 +0100 +++ src/gdb/doc/gdb.texinfo 2005-10-28 14:39:29.000000000 +0100 @@ -1006,6 +1006,27 @@ This is particularly useful when using t Note that targets that give their output via @value{GDBN}, as opposed to writing directly to @code{stdout}, will also be made silent. +@item -return-child-result +@cindex @code{--return-child-result} +The return code from @value{GDBN} will be the return code from the child +process (the process being debugged), with the following exceptions: + +@itemize @bullet +@item +@value{GDBN} exits abnormally. E.g. due to an incorrect argument or an +internal error. In this case the exit code is the same as it would have been +without @samp{-return-child-result}. +@item +The user quits with an explicit value. E.g. @samp{quit 1}. +@item +The child process never runs, or is not allowed to terminate, in which case +the exit code will be -1. +@end itemize + +This option is useful in conjunction with @samp{-batch} or @samp{-batch-silent}, +when @value{GDBN} is being used as a remote program loader or simulator +interface. + @item -nowindows @itemx -nw @cindex @code{--nowindows} --------------030907090902030803080106--