Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!HP-SDE.SDE.HP.COM!glenne%hplsla From: glenne%hplsla@HP-SDE.SDE.HP.COM (Glenn Engel) Newsgroups: gnu.gdb.bug Subject: gdb hangs forever when a remote system is not responding Message-ID: <8903161758.AA17886@labgre.HP.COM> Date: 16 Mar 89 17:58:31 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 52 When using gdb3.1.2 to attach to a remote system, it can hang forever waiting for a response from the remote system. Control-C does not interrupt. The patch below fixes this problem. These patches were applied on top of previous patches I sent in for remote.c. The changes are in the getpkt() function. -- | Glenn R. Engel | Hewlett-Packard | (206) 335-2066 | glenne%hplsla@hplabs.hp.com *** remote.c.orig Thu Mar 16 08:03:47 1989 --- remote.c Thu Mar 16 08:30:09 1989 *************** *** 498,503 int c; unsigned char c1, c2; extern kiodebug; while (1) { --- 498,505 ----- int c; unsigned char c1, c2; extern kiodebug; + /* allow immediate quit while reading from device, it could be hung */ + immediate_quit++; while (1) { *************** *** 527,532 write (remote_desc, "-", 1); } write (remote_desc, "+", 1); if (kiodebug) --- 529,536 ----- write (remote_desc, "-", 1); } + immediate_quit--; + write (remote_desc, "+", 1); if (kiodebug)