From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13795 invoked by alias); 6 Aug 2014 16:59:58 -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 13775 invoked by uid 89); 6 Aug 2014 16:59:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout25.012.net.il Received: from mtaout25.012.net.il (HELO mtaout25.012.net.il) (80.179.55.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Aug 2014 16:59:53 +0000 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N9W00A009FTRH00@mtaout25.012.net.il> for gdb-patches@sourceware.org; Wed, 06 Aug 2014 19:54:59 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W0099V9NND420@mtaout25.012.net.il>; Wed, 06 Aug 2014 19:54:59 +0300 (IDT) Date: Wed, 06 Aug 2014 16:59:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 6/8] Replace hardwired error handler in go32_create_inferior In-reply-to: <1407319948-2264-7-git-send-email-gbenson@redhat.com> To: Gary Benson Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <838un1pn8s.fsf@gnu.org> References: <1407319948-2264-1-git-send-email-gbenson@redhat.com> <1407319948-2264-7-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00103.txt.bz2 > 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.