This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] windows: do not crash if inferior


Hi,

in case of early exit of the inferior, gdb crashes due to an assertion failure in inferior_thread().
This can happen if the inferior is not able to load a DLL due to a permission issue.

I am not sure that this is the best fix, but at least it avoids the crash.

Tristan.

2010-01-13  gingold  <gingold@adacore.com>

        * windows-nat.c (do_initial_windows_stuff): Call error() if the
        inferior doesn't exist anymore.


diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index f91ca32..29a28a9 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1603,6 +1603,11 @@ do_initial_windows_stuff (struct target_ops *ops, DWORD p
     {
       stop_after_trap = 1;
       wait_for_inferior (0);
+
+      /* The inferior may have exited early, due to eg. a DLL load error.  */
+      if (ptid_equal (inferior_ptid, null_ptid))
+       error (_("inferior exited early"));
+
       tp = inferior_thread ();
       if (tp->stop_signal != TARGET_SIGNAL_TRAP)
        resume (0, tp->stop_signal);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]