]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Drop tclsh dependency
authorTom de Vries <tdevries@suse.de>
Fri, 26 Sep 2025 23:54:18 +0000 (01:54 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 26 Sep 2025 23:54:18 +0000 (01:54 +0200)
The test-case gdb.tui/tuiterm-2.exp uses a tcl script gdb.tcl that uses tclsh
as its interpreter:
...
 #!/usr/bin/env tclsh
...

I used tclsh because I assumed it was an existing dependency of
dejagnu/expect, but apparently [1] that's not the case.

IWBN to use some existing dependency instead.

Using expect instead of tclsh also works on my system, but looking in
/usr/bin/runtest I realized that someone might have a dejagnu setup with
a custom expect indicated by setting an env var EXPECT.  So to find expect
we'd have to mimic whatever runtest is doing to find expect, or do:
...
$ runtest --version -v | grep "Expect binary"
...
using the appropriate runtest.

That sounds non-trivial and fragile, so simply use a shell script with /bin/sh
interpreter instead.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
[1] https://sourceware.org/pipermail/gdb-patches/2025-September/220736.html

gdb/testsuite/gdb.tui/gdb.sh [moved from gdb/testsuite/gdb.tui/gdb.tcl with 93% similarity]
gdb/testsuite/gdb.tui/tuiterm-2.exp

similarity index 93%
rename from gdb/testsuite/gdb.tui/gdb.tcl
rename to gdb/testsuite/gdb.tui/gdb.sh
index ca207edb1c606323f100649721f10dc2cde59f73..0079a3fb4416cbb1fce9ef9da579b9f18fb2344e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env tclsh
+#!/bin/sh
 
 # Copyright 2025 Free Software Foundation, Inc.
 
@@ -15,6 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-puts "foo\033(%5"
+printf "foo\033(%%5"
 
-gets stdin
+read
index 3dfbd63c5fb2cc299d68adab8df51dd790ab8c2d..9e3ddc72eefcf4c5f8edaf1b8d8137d574716800 100644 (file)
@@ -153,8 +153,8 @@ with_override Term::accept_gdb_output test_accept_gdb_output {
 }
 
 proc_with_prefix unrecognized_escape_sequence {} {
-    if { [spawn $::srcdir/$::subdir/gdb.tcl] == 0 } {
-       unsupported "cannot spawn gdb.tcl"
+    if { [spawn $::srcdir/$::subdir/gdb.sh] == 0 } {
+       unsupported "cannot spawn gdb.sh"
        return
     }
     switch_gdb_spawn_id $spawn_id