From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12252 invoked by alias); 8 Aug 2014 11:38:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12152 invoked by uid 89); 8 Aug 2014 11:38:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Aug 2014 11:38:48 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s78BciEo013890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Aug 2014 07:38:44 -0400 Received: from blade.nx (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s78BchFT023897; Fri, 8 Aug 2014 07:38:44 -0400 Received: by blade.nx (Postfix, from userid 1000) id C80DB2640DF; Fri, 8 Aug 2014 12:38:42 +0100 (BST) Date: Fri, 08 Aug 2014 11:38:00 -0000 From: Gary Benson To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 6/8] Replace hardwired error handler in go32_create_inferior Message-ID: <20140808113842.GA18439@blade.nx> References: <1407319948-2264-1-git-send-email-gbenson@redhat.com> <1407319948-2264-7-git-send-email-gbenson@redhat.com> <838un1pn8s.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <838un1pn8s.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00165.txt.bz2 Eli Zaretskii wrote: > > From: Gary Benson > > Date: Wed, 6 Aug 2014 11:12:26 +0100 > > > > go32_create_inferior invokes a hardwired fprintf/exit error > > handler if v2loadimage fails. I could find no reason for this > > other than that the block seems to have been copy-and-pasted > > from v2loadimage's manpage. > > AFAIR, it's actually the other way around: the example in the > documentation was copy-pasted from GDB, bit never mind. > > > This commit replaces the hardwired handler with a call to error. > > Thanks, but... > > > - if (v2loadimage (exec_file, cmdline, start_state)) > > - { > > - environ = env_save; > > - printf_unfiltered ("Load failed for image %s\n", exec_file); > > - exit (1); > > - } > > + result = v2loadimage (exec_file, cmdline, start_state); > > + > > environ = env_save; > > xfree (cmdline); > > > > + if (!result) > > + error (_("Load failed for image %s", exec_file); > > ...the last test is inverted: v2loadimage returns zero if it > succeeds, not if it fails (see also the old code). > > OK with that change. Thanks Eli. I've updated my tree to "if (result != 0) error". I won't mail an updated patch unless anyone wants one. Cheers, Gary -- http://gbenson.net/