[RFA] fix win32-nat failure

Pierre Muller
2008-10-02T11:58:09Z

I ran a testsuite on cygwin with the patch below,
I got this results:

=== gdb Summary ===

# of expected passes 11190
# of unexpected failures 469
# of expected failures 58
# of unknown successes 2
# of known failures 110
# of unresolved testcases 40
# of untested testcases 15
# of unsupported tests 23
/usr/local/src/gdbcvs/build-bare/gdb/testsuite/../../gdb/gdb version
6.8.50.200
81002-cvs -nx

make: *** [check] Error 1

This seems like a "normal" outcome for cygwin native gdb.

Thus I would like to get approval for the following patch,

Pierre Muller
Pascal language support maintainer for GDB

ChangeLog entry:

2008-10-02 Pierre Muller <muller@ics.u-strasbg.fr>
Pedro Alves <pedro@codesourcery.com>

* win32-nat.c (do_initial_win32_stuff): Set inferior_ptid.

Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.164
diff -u -p -r1.164 win32-nat.c
--- gdb/win32-nat.c 22 Sep 2008 15:21:30 -0000 1.164
+++ gdb/win32-nat.c 2 Oct 2008 08:59:25 -0000
@@ -1550,6 +1550,12 @@ do_initial_win32_stuff (DWORD pid, int a
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 ();