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: [PATCH 2/2] [gdb/testsuite] Fix gdb.python/py-section-script.exp with older objdump
Date: Tue, 28 Jul 2026 18:00:16 +0200	[thread overview]
Message-ID: <20260728160016.3087552-3-tdevries@suse.de> (raw)
In-Reply-To: <20260728160016.3087552-1-tdevries@suse.de>

On AlmaLinux 9.8 ppc64le with objdump 2.35.2 I run into:
...
ERROR: tcl error sourcing gdb/testsuite/gdb.python/py-section-script.exp.
ERROR: tcl error code CHILDSTATUS 3614626 1
ERROR: objdump: unrecognized option '--decompress'
...

Fix this by using remote_exec instead of exec, and checking the result.

Tested on x86_64-linux and ppc64le-linux.
---
 .../gdb.python/py-section-script.exp          | 21 ++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite/gdb.python/py-section-script.exp
index 04ff14a8d0a..6a83ff31602 100644
--- a/gdb/testsuite/gdb.python/py-section-script.exp
+++ b/gdb/testsuite/gdb.python/py-section-script.exp
@@ -65,9 +65,24 @@ foreach_with_prefix variant {plain compressed} {
 
     if {$variant == "compressed"} {
 	set objdump_program [gdb_find_objdump]
-	set debug_sect [exec $objdump_program -j .debug_gdb_scripts -s "$the_binfile"]
-	set debug_sect_decompressed [exec $objdump_program -j .debug_gdb_scripts \
-			    -s "$the_binfile" --decompress]
+
+	set res \
+	    [remote_exec host \
+		 "$objdump_program -j .debug_gdb_scripts -s \"$the_binfile\""]
+	if {[lindex $res 0] != 0} {
+	    unsupported "Couldn't run objdump"
+	    return
+	}
+	set debug_sect [lindex $res 1]
+
+	set res \
+	    [remote_exec host \
+		 "$objdump_program -j .debug_gdb_scripts -s \"$the_binfile\" --decompress"]
+	if {[lindex $res 0] != 0} {
+	    unsupported "Couldn't run objdump --decompress"
+	    return
+	}
+	set debug_sect_decompressed [lindex $res 1]
 
 	if {$debug_sect == $debug_sect_decompressed} {
 	    fail ".debug_gdb_scripts in $the_binfile is not compressed"
-- 
2.51.0


      parent reply	other threads:[~2026-07-28 16:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 16:00 [PATCH 0/2] [gdb/testsuite] Two fixes in gdb.python/py-section-script.exp Tom de Vries
2026-07-28 16:00 ` [PATCH 1/2] [gdb/testsuite] Fix gdb.python/py-section-script.exp with make-check-all.sh Tom de Vries
2026-07-28 16:00 ` 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=20260728160016.3087552-3-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