This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] SIGTTIN problem in win32-nat.c


I just applied the below patch.  It solves a problem when gdb is running
with the TUI user interface.  When starting an inferior process, TUI is
generating output while the terminal process group is set to the
inferior process.  This results in GDB going immediatly into the
background.  While it's easy to call `fg' on the shell command line for
shells supporting job control, it's a problem when running in a native
Windows shell, and a general annoyance.


        * win32-nat.c (win32_wait): Reset terminal pgrp to GDB.
        (do_initial_win32_stuff): Call terminal_init_inferior_with_pgrp
        instead of target_terminal_init since inferior_ptid isn't set yet.

Index: win32-nat.c
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.125
diff -p -u -r1.125 win32-nat.c
--- win32-nat.c	9 Jan 2007 17:58:59 -0000	1.125
+++ win32-nat.c	12 Feb 2007 12:37:05 -0000
@@ -1542,6 +1542,8 @@ win32_wait (ptid_t ptid, struct target_w
   int pid = PIDGET (ptid);
+  target_terminal_ours ();
   /* We loop when we get a non-standard exception rather than return
      with a SPURIOUS because resume can try and step or modify things,
      which needs a current_thread->h.  But some of these exceptions mark
@@ -1587,7 +1589,7 @@ do_initial_win32_stuff (DWORD pid)
   clear_proceed_status ();
   init_wait_for_inferior ();
-  target_terminal_init ();
+  terminal_init_inferior_with_pgrp (pid);
   target_terminal_inferior ();
   while (1)

Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]