This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] windows: do not crash if inferior
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