[gdb] Mention --with/without-system-readline for --configuration
authorTom de Vries <tdevries@suse.de>
Tue, 30 May 2023 15:49:31 +0000 (17:49 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 May 2023 15:49:31 +0000 (17:49 +0200)
Simon reported that the new test-case gdb.tui/pr30056.exp fails with system
readline.

This is because the test-case requires a fix in readline that's present in our
in-repo copy of readline, but most likely not in any system readline yet.

Fix this by:
- mentioning --with-system-readline or --without-system-readline in the
  configuration string.
- adding a new proc with_system_readline that makes this information available
  in the testsuite.
- using this in test-case gdb.tui/pr30056.exp to declare it unsupported for
  --with-system-readline.

Tested on x86_64-linux.

Reported-By: Simon Marchi <simon.marchi@efficios.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/testsuite/gdb.tui/pr30056.exp
gdb/testsuite/lib/gdb.exp
gdb/top.c

index 7a57a5627a8ee0307316f21a9b6844d6b8a1bf21..4ca7a8b56a878c9c9a01b2dcbb6eb77074617696 100644 (file)
 
 # Regression test for PR30056.
 
+# This PR is fixed in the in-repo copy of readline.  System readline may or
+# may not be fixed, so skip this test-case.
+require !with_system_readline
+
 tuiterm_env
 
 save_vars { env(LC_ALL) } {
index 133d914aff8cbea8c4b0b58ec21fcb8641547ab3..294d136a547d2bbde6c0bd34bbbd797d6ab3d5ce 100644 (file)
@@ -2565,6 +2565,14 @@ gdb_caching_proc allow_python_tests {} {
     return [expr {[string first "--with-python" $output] != -1}]
 }
 
+# Return a 1 for configurations that use system readline rather than the
+# in-repo copy.
+
+gdb_caching_proc with_system_readline {} {
+    set output [remote_exec host $::GDB "$::INTERNAL_GDBFLAGS --configuration"]
+    return [expr {[string first "--with-system-readline" $output] != -1}]
+}
+
 gdb_caching_proc allow_dap_tests {} {
     if { ![allow_python_tests] } {
        return 0
index 92de30a14725c49845db2b89b45d2fc672f55e15..90ddc5f5ea7384f19cc7b8ff8ae1ee1feef64684 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1560,6 +1560,16 @@ This GDB was configured as follows:\n\
 "));
 #endif
 
+#ifdef HAVE_READLINE_READLINE_H
+  gdb_printf (stream, _("\
+            --with-system-readline\n\
+"));
+#else
+  gdb_printf (stream, _("\
+            --without-system-readline\n\
+"));
+#endif
+
 #ifdef RELOC_SRCDIR
   gdb_printf (stream, _("\
             --with-relocated-sources=%s\n\