diff options
Diffstat (limited to 'gdb/inferior.c')
-rw-r--r-- | gdb/inferior.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c index 515268f..e71104d 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -135,8 +135,17 @@ add_inferior_silent (int pid) inf->control.stop_soon = NO_STOP_QUIETLY; inf->num = ++highest_inferior_num; - inf->next = inferior_list; - inferior_list = inf; + + if (inferior_list == NULL) + inferior_list = inf; + else + { + struct inferior *last; + + for (last = inferior_list; last->next != NULL; last = last->next) + ; + last->next = inf; + } inf->environment = make_environ (); init_environ (inf->environment); |