From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10695 invoked by alias); 17 Apr 2014 18:48:42 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10686 invoked by uid 89); 17 Apr 2014 18:48:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_40,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ausc60ps301.us.dell.com Received: from ausc60ps301.us.dell.com (HELO ausc60ps301.us.dell.com) (143.166.148.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 17 Apr 2014 18:48:41 +0000 X-LoopCount0: from 10.175.216.251 From: To: CC: Subject: Re: specifying gdb's exit code Date: Thu, 17 Apr 2014 19:08:00 -0000 Message-ID: <8409270A-85C4-43D0-9D4D-5CB676B9DF31@dell.com> References: In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00051.txt.bz2 You can do this using Python scripting: (gdb) python import sys; sys.exit(123) paul On Apr 17, 2014, at 2:43 PM, Daniel Gutson wrote: > Hi, >=20 > Due to a specific need, I was thinking of a way to specify (e.g. > from a script) the gdb exit status, > specially in terms of the $_exitcode. >=20 > AFAIK, this is not currently possible since gdb returns only about the > finalization execution status > of the inf. I understand that these could be messed, specially when in > --batch mode, but it should be > responsibility of the developer to specify an exit code different to > those gdb may return, and also > responsibility of the invoking program to make such distinction. >=20 > The options I can think about are: > - set a convenience var, such as $_gdbexitcode > - set gdb-exit-code [n] > - add an optional argument to the 'quit' command (so "quit > $_exitcode" is available) >=20 > Ideas? >=20 > Thanks! >=20 > Daniel. >=20 > --=20 >=20 > Daniel F. Gutson > Chief Engineering Officer, SPD >=20 >=20 > San Lorenzo 47, 3rd Floor, Office 5 >=20 > C=F3rdoba, Argentina >=20 >=20 > Phone: +54 351 4217888 / +54 351 4218211 >=20 > Skype: dgutson