X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Finferior.c;h=28c586792b8bc63219242809ee602c4b192a7487;hb=abc72ce4c676be2f368fa0ace766ed29cd444020;hp=f1991c97381077c4088c9f2c54c1fa3dcb8c7dfc;hpb=a79b8f6ea8c26650ad9b6f29e3df46f86f4f3530;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inferior.c b/gdb/inferior.c index f1991c9738..28c586792b 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -68,6 +68,7 @@ static void restore_inferior (void *arg) { struct inferior *saved_inferior = arg; + set_current_inferior (saved_inferior); } @@ -80,6 +81,7 @@ save_current_inferior (void) { struct cleanup *old_chain = make_cleanup (restore_inferior, current_inferior_); + return old_chain; } @@ -283,6 +285,7 @@ void exit_inferior (int pid) { struct inferior *inf = find_inferior_pid (pid); + exit_inferior_1 (inf, 0); if (print_inferior_events) @@ -293,6 +296,7 @@ void exit_inferior_silent (int pid) { struct inferior *inf = find_inferior_pid (pid); + exit_inferior_1 (inf, 1); } @@ -308,6 +312,7 @@ void detach_inferior (int pid) { struct inferior *inf = find_inferior_pid (pid); + exit_inferior_1 (inf, 1); if (print_inferior_events) @@ -527,8 +532,6 @@ print_inferior (struct ui_out *uiout, int requested_inferior) /* Compute number of inferiors we will print. */ for (inf = inferior_list; inf; inf = inf->next) { - struct cleanup *chain2; - if (requested_inferior != -1 && inf->num != requested_inferior) continue;