This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

gdb not setting controlling terminal


Hello

With gdb-4.17.0.11 under linux-2.2.5 & glibc-2.1 (all compiled
by egcs-1.1.X), I have the following gdb session on the console:

-----------
~$ gdb /usr/bin/less
GNU gdb 4.17.0.11 with Linux support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(no debugging symbols found)...
(gdb) set args a.c
(gdb) tty /dev/tty7
(gdb) run
Starting program: /usr/bin/less a.c
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGTTIN, Stopped (tty input).
0x400fa354 in __read ()
(gdb)
------------

This happens after 'less' displayed its first screen (on /dev/tty7).

'ps' shows that that less runs _not_ on /dev/tty7 but on /dev/tty1
where gdb was started.  Looks like 'tty' command in gdb redirects
stdin/out/err but not the controlling terminal - contrary to the docs.

/dev/tty7 is a fresh virtual console owned by the appropriate user.
It is readable and writeable. The above session runs fine on my
backup system: linux-2.0.33, libc-5.4.44, gdb-4.16.

Regards
Sergei


-- 
H.J. Lu (hjl@gnu.org)