2008-04-21 Paul Pluzhnikov * gdb/infrun.c (wait_for_inferior): Call target_terminal_inferior before blocking. --- gdb/infrun.c.orig 2008-04-21 18:00:15.159567000 -0700 +++ gdb/infrun.c 2008-04-21 23:19:16.802206000 -0700 @@ -1023,12 +1023,14 @@ wait_for_inferior (int treat_exec_as_sig status mechanism. */ registers_changed (); while (1) { + /* Make sure terminal is switched to inferior before waiting for it. */ + target_terminal_inferior (); if (deprecated_target_wait_hook) ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp); else ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp); if (treat_exec_as_sigtrap && ecs->ws.kind == TARGET_WAITKIND_EXECD)