Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>,
	 Tristan Gingold <gingold@adacore.com>
Subject: Re: [RFA] windows: do not crash if inferior
Date: Wed, 20 Jan 2010 16:41:00 -0000	[thread overview]
Message-ID: <201001201641.45826.pedro@codesourcery.com> (raw)
In-Reply-To: <20100119092227.GN17397@adacore.com>

On Tuesday 19 January 2010 09:22:27, Joel Brobecker wrote:
> I don't see a "generic" way of dealing with this situation.  So the type
> of approach you took (returning early from do_initial_windows_stuff)
> seems to be the only approach I can see. I was initially a little
> reluctant about throwing an error: As far as I can tell from the code,
> the debugger should have already printed an error message such as
> "Inferior exited with code ..." (is that correct?) - and so an extra
> "inferior exited early" message could be considered superfluous. However,
> if you do not error-out now, core GDB will assume that target_create_inferior
> succeeded and thus possibly do something unexpected as well.
> 
> Bottom line - I cannot propose a better approach short of revamping
> a bit the target_create_inferior routine to add error-handling,
> I think the patch is fine.

IMO, the clean and proper solution is to stop using
wait_for_inferior from within target_create_inferior, similarly
to fork-child.c:startup_inferior --- fork-child.c:startup_inferior
handles the similar case of the inferior process exiting early
during startup before being fully properly created.

-- 
Pedro Alves


      parent reply	other threads:[~2010-01-20 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  9:25 Tristan Gingold
2010-01-19  9:22 ` Joel Brobecker
2010-01-20 16:16   ` Christopher Faylor
2010-01-20 16:35     ` Pedro Alves
2010-01-20 17:38     ` Christopher Faylor
2010-01-20 18:57       ` Christopher Faylor
2010-01-20 19:12       ` Pedro Alves
2010-01-21 17:57         ` Christopher Faylor
2010-01-26 15:59           ` Tristan Gingold
2010-01-28 14:55             ` Christopher Faylor
2010-01-20 16:41   ` Pedro Alves [this message]

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=201001201641.45826.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.com \
    /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