Blame SOURCES/testing-custom-inputrc.patch

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