public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb] Mention --with/without-system-readline for --configuration
Date: Tue, 30 May 2023 15:49:35 +0000 (GMT)	[thread overview]
Message-ID: <20230530154935.91B263858D20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=37d9880d653c1d91e763c6b6ab22c28883996447

commit 37d9880d653c1d91e763c6b6ab22c28883996447
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue May 30 17:49:31 2023 +0200

    [gdb] Mention --with/without-system-readline for --configuration
    
    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>

Diff:
---
 gdb/testsuite/gdb.tui/pr30056.exp |  4 ++++
 gdb/testsuite/lib/gdb.exp         |  8 ++++++++
 gdb/top.c                         | 10 ++++++++++
 3 files changed, 22 insertions(+)

diff --git a/gdb/testsuite/gdb.tui/pr30056.exp b/gdb/testsuite/gdb.tui/pr30056.exp
index 7a57a5627a8..4ca7a8b56a8 100644
--- a/gdb/testsuite/gdb.tui/pr30056.exp
+++ b/gdb/testsuite/gdb.tui/pr30056.exp
@@ -15,6 +15,10 @@
 
 # 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) } {
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 133d914aff8..294d136a547 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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
diff --git a/gdb/top.c b/gdb/top.c
index 92de30a1472..90ddc5f5ea7 100644
--- 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\

                 reply	other threads:[~2023-05-30 15:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230530154935.91B263858D20@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).