Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 3/3] [gdb/testsuite] Disable part of gdb.python/python.exp for !readline_is_used
Date: Sun,  1 Nov 2026 15:07:49 +0100	[thread overview]
Message-ID: <20261101140752.548879-4-tdevries@suse.de> (raw)
In-Reply-To: <20261101140752.548879-1-tdevries@suse.de>

With host board local-remote-host-notty, target board
remote-gdbserver-on-localhost and test-case gdb.python/python.exp I ran into:
...
(gdb) python gdb.execute('set logging enabled on')^M
FAIL: $exp: enable logging via python (timeout)
...

The problem is that there's no visible prompt because of the combination of
"set editing off" (due to using local-remote-host-notty) and logging.  I don't
know whether this is a bug or not.  I've filed a PR [1] about this.

Regardless, this problem is not specific to python, so just skip the logging
part of the test-case if !readline_is_used.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=34926
---
 gdb/testsuite/gdb.python/python.exp | 41 ++++++++++++++++-------------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index f8a2e35c961..b34e4f61c31 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -575,21 +575,26 @@ foreach type {Instruction LazyString Membuf Record RecordFunctionSegment \
 	"gdb.$type is registered"
 }
 
-set logfile [host_standard_output_file gdb.txt]
-gdb_test_no_output "set logging file $logfile" \
-    "set logging file [file tail $logfile]"
-gdb_test_no_output "set logging redirect on" \
-    "enable logging redirect via python"
-gdb_test_no_output "python gdb.execute('set logging enabled on')" \
-    "enable logging via python"
-
-# Even with logging redirect on, this should capture the output.
-gdb_test_no_output "python x = gdb.execute('print 23', to_string=True)" \
-    "print from python with logging redirect"
-
-gdb_test "set logging enabled off" \
-    "Done logging to .*gdb.txt." \
-    "disable logging"
-
-gdb_test "python print(x)" " = 23.*" \
-    "python still captured output"
+# The combination of logging and !readline_is_used means we don't get a
+# visible prompt (PR cli/34926), so skip this part.
+set readline_is_used [readline_is_used]
+if {$readline_is_used} {
+    set logfile [host_standard_output_file gdb.txt]
+    gdb_test_no_output "set logging file $logfile" \
+	"set logging file [file tail $logfile]"
+    gdb_test_no_output "set logging redirect on" \
+	"enable logging redirect via python"
+    gdb_test_no_output "python gdb.execute('set logging enabled on')" \
+	"enable logging via python"
+
+    # Even with logging redirect on, this should capture the output.
+    gdb_test_no_output "python x = gdb.execute('print 23', to_string=True)" \
+	"print from python with logging redirect"
+
+    gdb_test "set logging enabled off" \
+	"Done logging to .*gdb.txt." \
+	"disable logging"
+
+    gdb_test "python print(x)" " = 23.*" \
+	"python still captured output"
+}
-- 
2.51.0


      parent reply	other threads:[~2026-11-01 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 14:07 [pushed 0/3] [gdb/testsuite] A few fixes in gdb.python/python.exp Tom de Vries
2026-11-01 14:07 ` [pushed 1/3] [gdb/testsuite] Handle help() timeout " Tom de Vries
2026-11-01 14:07 ` [pushed 2/3] [gdb/testsuite] Fix remote host confusion " Tom de Vries
2026-11-01 14:07 ` Tom de Vries [this message]

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=20261101140752.548879-4-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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