Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 6/8] Replace hardwired error handler in go32_create_inferior
Date: Fri, 08 Aug 2014 11:38:00 -0000	[thread overview]
Message-ID: <20140808113842.GA18439@blade.nx> (raw)
In-Reply-To: <838un1pn8s.fsf@gnu.org>

Eli Zaretskii wrote:
> > From: Gary Benson <gbenson@redhat.com>
> > 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/


  reply	other threads:[~2014-08-08 11:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 10:12 [PATCH 0/8] Error handling cleanups Gary Benson
2014-08-06 10:12 ` [PATCH 2/8] Make error usable earlier Gary Benson
2014-08-06 10:12 ` [PATCH 4/8] Replace hardwired error handlers in tui_initialize_io Gary Benson
2014-08-06 10:12 ` [PATCH 8/8] Unify startup and option-parsing warnings Gary Benson
2014-08-06 10:12 ` [PATCH 3/8] Make warning usable earlier Gary Benson
2014-08-06 10:25 ` [PATCH 5/8] Replace hardwired error handler in captured_main Gary Benson
2014-08-06 10:25 ` [PATCH 7/8] Replace all usage errors with calls to error Gary Benson
2014-08-06 10:34 ` [PATCH 1/8] Make internal_vproblem always work Gary Benson
2014-08-06 10:52 ` [PATCH 6/8] Replace hardwired error handler in go32_create_inferior Gary Benson
2014-08-06 16:59   ` Eli Zaretskii
2014-08-08 11:38     ` Gary Benson [this message]
2014-08-28 14:09 ` [PATCH 0/8] Error handling cleanups Pedro Alves
2014-08-29  9:19   ` [COMMITTED PATCH " Gary Benson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140808113842.GA18439@blade.nx \
    --to=gbenson@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox