* linux-low.c (linux_wait): Clear all_processes list also.
authorDaniel Jacobowitz <drow@false.org>
Tue, 23 Mar 2004 21:14:24 +0000 (21:14 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 23 Mar 2004 21:14:24 +0000 (21:14 +0000)
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c

index e718fa6..3168606 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
+
+       * linux-low.c (linux_wait): Clear all_processes list also.
+
 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
 
        * linux-low.c: Include <errno.h>.  Remove extern declaration of
index a3d6a54..5733180 100644 (file)
@@ -685,13 +685,17 @@ retry:
          fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
          *status = 'W';
          clear_inferiors ();
+         free (all_processes.head);
+         all_processes.head = all_processes.tail = NULL;
          return ((unsigned char) WEXITSTATUS (w));
        }
       else if (!WIFSTOPPED (w))
        {
          fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
-         clear_inferiors ();
          *status = 'X';
+         clear_inferiors ();
+         free (all_processes.head);
+         all_processes.head = all_processes.tail = NULL;
          return ((unsigned char) WTERMSIG (w));
        }
     }