Blame SOURCES/testing-custom-inputrc.patch

a8223e
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
a8223e
From: Keith Seitz <keiths@redhat.com>
a8223e
Date: Tue, 23 Mar 2021 09:32:37 -0700
a8223e
Subject: testing-custom-inputrc.patch
a8223e
a8223e
;; Backport "Disable bracketed paste mode in GDB tests"
a8223e
;; (Tom Tromey)
a8223e
a8223e
   commit 1af4c9c4209c3478224f18dfb79dc09567b96705
a8223e
   Author: Tom Tromey <tom@tromey.com>
a8223e
   Date:   Sat Jan 23 08:52:45 2021 -0700
a8223e
a8223e
    Disable bracketed paste mode in GDB tests
a8223e
a8223e
    I have a patch to import GNU readline 8.1 into GDB.  However, when
a8223e
    running the tests, there were a number of failures due to "bracketed
a8223e
    paste mode".  This is a terminal feature that readline 8.1 enables by
a8223e
    default.
a8223e
a8223e
    The simplest way to work around this was to always make a ".inputrc"
a8223e
    for GDB tests that will tell readline to disable brackted paste mode.
a8223e
a8223e
    gdb/testsuite/ChangeLog
a8223e
    2021-01-23  Tom Tromey  <tom@tromey.com>
a8223e
a8223e
            * lib/gdb.exp (default_gdb_init): Set INPUTRC to a cached file.
a8223e
a8223e
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
a8223e
--- a/gdb/testsuite/lib/gdb.exp
a8223e
+++ b/gdb/testsuite/lib/gdb.exp
a8223e
@@ -5135,13 +5135,14 @@ proc default_gdb_init { test_file_name } {
a8223e
     setenv LC_CTYPE C
a8223e
     setenv LANG C
a8223e
 
a8223e
-    # Don't let a .inputrc file or an existing setting of INPUTRC mess up
a8223e
-    # the test results.  Even if /dev/null doesn't exist on the particular
a8223e
-    # platform, the readline library will use the default setting just by
a8223e
-    # failing to open the file.  OTOH, opening /dev/null successfully will
a8223e
-    # also result in the default settings being used since nothing will be
a8223e
-    # read from this file.
a8223e
-    setenv INPUTRC "/dev/null"
a8223e
+    # Don't let a .inputrc file or an existing setting of INPUTRC mess
a8223e
+    # up the test results.  Certain tests (style tests and TUI tests)
a8223e
+    # want to set the terminal to a non-"dumb" value, and for those we
a8223e
+    # want to disable bracketed paste mode.  Versions of Readline
a8223e
+    # before 8.0 will not understand this and will issue a warning.
a8223e
+    # We tried using a $if to guard it, but Readline 8.1 had a bug in
a8223e
+    # its version-comparison code that prevented this for working.
a8223e
+    setenv INPUTRC [cached_file inputrc "set enable-bracketed-paste off"]
a8223e
 
a8223e
     # This disables style output, which would interfere with many
a8223e
     # tests.