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
-#!/usr/bin/env tclsh
+#!/bin/sh
# Copyright 2025 Free Software Foundation, Inc.
# 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
}
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