This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: Almost-patch: gdb -vs- background


On Tue, Nov 21, 2000 at 10:34:10PM -0700, Tom Tromey wrote:
>It is a well-known bug that you can't run Insight in the background.
>Eventually gdb tries to access the controlling terminal and is
>stopped.
>
>This patch tries to fix the problem.  However, it only works for the
>termios case.  I'm reluctant to recommend it for that reason.
>
>I wonder if it would be better to just set `gdb_has_a_terminal_flag'
>to `no' whenever use_windows is set.
>
>Any comments on this?

I agree that the tcgetpgrp stuff might be a little iffy.  It will break
on non-termios systems, even though those are not all that common
nowadays.

(Oddly enough, I think this code will do the right thing under Cygwin.
That pgrp, terminal pgrp, sid stuff is a lot of fun to implement.)

IMO, setting 'gdb_has_a_terminal_flag = no' when use_windows is set is a
perfectly fine solution, though.

cgf

>Index: inflow.c
>===================================================================
>RCS file: /cvs/src/src/gdb/inflow.c,v
>retrieving revision 1.3
>diff -u -r1.3 inflow.c
>--- inflow.c	2000/07/30 01:48:25	1.3
>+++ inflow.c	2000/11/22 05:18:59
>@@ -148,6 +149,8 @@
> 	      gdb_has_a_terminal_flag = yes;
> #ifdef HAVE_TERMIOS
> 	      our_process_group = tcgetpgrp (0);
>+	      if (use_windows && our_process_group != getpgrp ())
>+		gdb_has_a_terminal_flag = no;
> #endif
> #ifdef HAVE_TERMIO
> 	      our_process_group = getpgrp ();

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