From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12472 invoked by alias); 12 Jul 2011 21:08:43 -0000 Received: (qmail 12463 invoked by uid 22791); 12 Jul 2011 21:08:42 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_40 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog104.obsmtp.com (HELO eu1sys200aog104.obsmtp.com) (207.126.144.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jul 2011 21:08:27 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKThy3yXKE1mMowUsdnmrrAFfxELl9v3PB@postini.com; Tue, 12 Jul 2011 21:08:27 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C875D6E3 for ; Tue, 12 Jul 2011 21:08:24 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas2.st.com [10.75.90.16]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 679002CE2 for ; Tue, 12 Jul 2011 21:08:24 +0000 (GMT) Received: from SAFEX1MAIL1.st.com ([10.75.90.1]) by SAFEX1HUBCAS2.st.com ([10.75.90.16]) with mapi; Tue, 12 Jul 2011 23:08:24 +0200 From: Michel METZGER To: "gdb@sourceware.org" Date: Tue, 12 Jul 2011 21:08:00 -0000 Subject: GDB return code and batch mode Message-ID: <5B4CE209869C6A4797F5FAA0B348F0A0D9F4650FB0@SAFEX1MAIL1.st.com> x-cr-hashedpuzzle: BRug ChcP DLvw Dlux DmcE Dz3/ D3Go Ei3/ ElWK E7tU GOPp H0NY IbrA Iqh7 I0DU J6gV;1;ZwBkAGIAQABzAG8AdQByAGMAZQB3AGEAcgBlAC4AbwByAGcA;Sosha1_v1;7;{43BA05AE-C4E2-4A88-A63D-BB73EEB1C665};bQBpAGMAaABlAGwALgBtAGUAdAB6AGcAZQByAEAAcwB0AC4AYwBvAG0A;Tue, 12 Jul 2011 21:08:21 GMT;RwBEAEIAIAByAGUAdAB1AHIAbgAgAGMAbwBkAGUAIABhAG4AZAAgAGIAYQB0AGMAaAAgAG0AbwBkAGUA x-cr-puzzleid: {43BA05AE-C4E2-4A88-A63D-BB73EEB1C665} Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes 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 X-SW-Source: 2011-07/txt/msg00071.txt.bz2 Hi, I'm probably missing something here, the question is: what is it? ;) According to the documentation, -batch has the following effect:=20 "Exit with status 0 after processing all the command files specified with `= -x' (and all commands from initialization files, if not inhibited with `-n'= ). Exit with nonzero status if an error occurs in executing the gdb command= s in the command files." A quick test: $ gdb -batch -x "gdb.script" with a file gdb.script containing the line: file toto (of course toto doesn't exist, to raise an error). The output is: gdb.script:1: Error in sourced command file: toto: No such file or directory. $ echo $? 0 Ideas?=20 Regards, Michel Metzger.