From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9CDC43858C53; Thu, 7 Apr 2022 10:32:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CDC43858C53 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29032] [gdb][test-case failure, taskset] FAIL: gdb.base/eof-exit.exp: with non-dump terminal: close GDB with eof (timeout) Date: Thu, 07 Apr 2022 10:32:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 10:32:31 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29032 --- Comment #6 from Tom de Vries --- OK, let's try again: ... diff --git a/gdb/event-top.c b/gdb/event-top.c index b628f0397cb..8ff4846b405 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -43,6 +43,7 @@ #include "async-event.h" #include "bt-utils.h" #include "pager.h" +#include "termios.h" /* readline include files. */ #include "readline/readline.h" @@ -1312,6 +1313,12 @@ gdb_setup_readline (int editing) one instance of readline. */ if (ISATTY (ui->instream) && editing && ui =3D=3D main_ui) { + struct termios termios; + tcgetattr (fileno (ui->instream), &termios); + termios.c_lflag &=3D ~(ICANON); + tcsetattr (fileno (ui->instream), TCSANOW, &termios); + //fprintf (stderr, "Clearing ICANON on fileno %d\n", fileno (ui->instream)); m=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 /* Tell gdb that we will be using the readline library. This could be overwritten by a command in .gdbinit like 'set editing on' or 'off'. */ diff --git a/gdb/top.c b/gdb/top.c index e776ac2d70e..f796d12a14e 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -57,6 +57,7 @@ #include "gdbsupport/pathstuff.h" #include "cli/cli-style.h" #include "pager.h" +#include "termios.h" /* readline include files. */ #include "readline/readline.h" @@ -1774,6 +1775,15 @@ undo_terminal_modifications_before_exit (void) #endif gdb_disable_readline (); + if (ISATTY (current_ui->instream)) + { + struct termios termios; + tcgetattr (fileno (current_ui->instream), &termios); + termios.c_lflag |=3D (ICANON); + tcsetattr (fileno (current_ui->instream), TCSANOW, &termios); + //fprintf (stderr, "Restoring ICANON on fileno %d\n", fileno (current_ui->ins tream)); + } + current_ui =3D saved_top_level; } ... This at least passes: - gdb.base/eof-exit.exp - gdb.ada/mi_catch_assert.exp - gdb.base/batch-preserve-term-settings.exp --=20 You are receiving this mail because: You are on the CC list for the bug.=