* inflow.c (gdb_getpgrp): New.
(gdb_has_a_terminal): Use get_getpgrp. (terminal_ours_1): If attach_flag is set, don't refetch inferior_process_group.
This commit is contained in:
parent
1fddbabb01
commit
64a0ac840e
2 changed files with 32 additions and 18 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-03-14 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* inflow.c (gdb_getpgrp): New.
|
||||||
|
(gdb_has_a_terminal): Use get_getpgrp.
|
||||||
|
(terminal_ours_1): If attach_flag is set, don't refetch
|
||||||
|
inferior_process_group.
|
||||||
|
|
||||||
2008-03-14 Pedro Alves <pedro@codesourcery.com>
|
2008-03-14 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
* features/library-list.dtd: Allow "section" elements as children
|
* features/library-list.dtd: Allow "section" elements as children
|
||||||
|
|
43
gdb/inflow.c
43
gdb/inflow.c
|
@ -98,6 +98,24 @@ static const char *inferior_thisrun_terminal;
|
||||||
|
|
||||||
int terminal_is_ours;
|
int terminal_is_ours;
|
||||||
|
|
||||||
|
#ifdef PROCESS_GROUP_TYPE
|
||||||
|
static PROCESS_GROUP_TYPE
|
||||||
|
gdb_getpgrp (void)
|
||||||
|
{
|
||||||
|
int process_group = -1;
|
||||||
|
#ifdef HAVE_TERMIOS
|
||||||
|
process_group = tcgetpgrp (0);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_TERMIO
|
||||||
|
process_group = getpgrp ();
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SGTTY
|
||||||
|
ioctl (0, TIOCGPGRP, &process_group);
|
||||||
|
#endif
|
||||||
|
return process_group;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
yes, no, have_not_checked
|
yes, no, have_not_checked
|
||||||
|
@ -132,15 +150,7 @@ gdb_has_a_terminal (void)
|
||||||
if (our_ttystate != NULL)
|
if (our_ttystate != NULL)
|
||||||
{
|
{
|
||||||
gdb_has_a_terminal_flag = yes;
|
gdb_has_a_terminal_flag = yes;
|
||||||
#ifdef HAVE_TERMIOS
|
our_process_group = gdb_getpgrp ();
|
||||||
our_process_group = tcgetpgrp (0);
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_TERMIO
|
|
||||||
our_process_group = getpgrp ();
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SGTTY
|
|
||||||
ioctl (0, TIOCGPGRP, &our_process_group);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,15 +349,12 @@ terminal_ours_1 (int output_only)
|
||||||
if (inferior_ttystate)
|
if (inferior_ttystate)
|
||||||
xfree (inferior_ttystate);
|
xfree (inferior_ttystate);
|
||||||
inferior_ttystate = serial_get_tty_state (stdin_serial);
|
inferior_ttystate = serial_get_tty_state (stdin_serial);
|
||||||
#ifdef HAVE_TERMIOS
|
|
||||||
inferior_process_group = tcgetpgrp (0);
|
if (!attach_flag)
|
||||||
#endif
|
/* If setpgrp failed in terminal_inferior, this would give us
|
||||||
#ifdef HAVE_TERMIO
|
our process group instead of the inferior's. See
|
||||||
inferior_process_group = getpgrp ();
|
terminal_inferior for details. */
|
||||||
#endif
|
inferior_process_group = gdb_getpgrp ();
|
||||||
#ifdef HAVE_SGTTY
|
|
||||||
ioctl (0, TIOCGPGRP, &inferior_process_group);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Here we used to set ICANON in our ttystate, but I believe this
|
/* Here we used to set ICANON in our ttystate, but I believe this
|
||||||
was an artifact from before when we used readline. Readline sets
|
was an artifact from before when we used readline. Readline sets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue