🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #330

gdb-3.4 readline destroys local tty modes +FIX

#330
From: John F. Peters
Date: Sat, 25 Nov 1989 20:58
45 lines
1751 bytes
Description:
	gdb3.4 on Vax 4.3bsd-Tahoe:
	When terminal parity is set to anything other than EVENP+ODDP,
	local modes are all zero after running gdb.

Repeat-By:
	* Find a terminal that generates parity in the eighth bit.
	* stty even -odd crt decctlq  (or odd -even)
	* run gdb
	* stty everything
	(local modes e.g. decctlq, crtbs, crterase, etc. are all gone)
Fix:
	In readline/readline.c, rl_prep_terminal and rl_deprep_terminal
	aren't symmetric.  Incoming local modes are saved only when parity
	is set to EVENP+ODDP, but later they're restored unconditionally.
	Thus when parity is set to anything but EVENP+ODDP, local modes
	get restored from a word that's all zero.

	This fix applies the same EVENP+ODDP test at restoration time.

-----
jfp@practic.com


*** readline.c.orig	Thu Oct 19 14:26:49 1989
--- readline.c	Sat Nov 25 10:14:40 1989
***************
*** 2078,2084 ****
    int tty = fileno (rl_instream);
  
  #if defined (TIOCLGET) && defined (LPASS8)
!   ioctl (tty, TIOCLSET, &local_mode_flags);
  #endif
  
  #ifdef TIOCSLTC
--- 2078,2085 ----
    int tty = fileno (rl_instream);
  
  #if defined (TIOCLGET) && defined (LPASS8)
!   if ((the_ttybuff.sg_flags & (ODDP | EVENP)) == (ODDP | EVENP))
!      ioctl (tty, TIOCLSET, &local_mode_flags);
  #endif
  
  #ifdef TIOCSLTC
Technical Details
Message-ID: <8911252058.AA04180@practic.com>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!practic.com!jfp

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!practic.com!jfp
From: jfp@practic.com (John F. Peters)
Newsgroups: gnu.gdb.bug
Subject: gdb-3.4 readline destroys local tty modes +FIX
Message-ID: <8911252058.AA04180@practic.com>
Date: 25 Nov 89 20:58:50 GMT
Sender: news@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 45