Blame SOURCES/testing-custom-inputrc.patch

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