From: Pierre Muller Date: Thu, 2 Oct 2008 14:20:07 +0000 (+0000) Subject: * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f9d052e600ed9436f9fd558d62a189c8cc3d43e;p=binutils-gdb.git * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 39c8c1058e1..bb0d830c1df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2008-10-02 Pierre Muller + Pedro Alves + + * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid. + + 2008-10-01 Tom Tromey * symtab.c (search_symbols): Update. diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 03b2f522251..cd4d5333fbe 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1550,6 +1550,12 @@ do_initial_win32_stuff (DWORD pid, int attaching) inf = add_inferior (pid); inf->attach_flag = attaching; + /* Make the new process the current inferior, so terminal handling + can rely on it. When attaching, we don't know about any thread + id here, but that's OK --- nothing should be referencing the + current thread until we report an event out of win32_wait. */ + inferior_ptid = pid_to_ptid (pid); + terminal_init_inferior_with_pgrp (pid); target_terminal_inferior (); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 03b2f522251..cd4d5333fbe 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1550,6 +1550,12 @@ do_initial_win32_stuff (DWORD pid, int attaching) inf = add_inferior (pid); inf->attach_flag = attaching; + /* Make the new process the current inferior, so terminal handling + can rely on it. When attaching, we don't know about any thread + id here, but that's OK --- nothing should be referencing the + current thread until we report an event out of win32_wait. */ + inferior_ptid = pid_to_ptid (pid); + terminal_init_inferior_with_pgrp (pid); target_terminal_inferior ();