From e447f3a122cd90d99582475c9a18f7b4c23468dd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 28 Jul 2025 10:06:00 -0600 Subject: Require Tcl 8.6.2 This changes the gdb test suite to require Tcl 8.6.2. This allows the removal of some more compatibility code. I wrote this as a separate patch so make it simpler to drop if some platform only provides Tcl 8.5. According to research in the bug, though, it seems like this isn't likely. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33205 Approved-By: Simon Marchi --- gdb/testsuite/gdb.tui/new-layout.exp | 15 +++++------- gdb/testsuite/lib/gdb.exp | 45 +----------------------------------- 2 files changed, 7 insertions(+), 53 deletions(-) diff --git a/gdb/testsuite/gdb.tui/new-layout.exp b/gdb/testsuite/gdb.tui/new-layout.exp index 914e10c..ece164a 100644 --- a/gdb/testsuite/gdb.tui/new-layout.exp +++ b/gdb/testsuite/gdb.tui/new-layout.exp @@ -45,15 +45,12 @@ gdb_test "tui new-layout example src 1 src 1" \ gdb_test "tui new-layout example src 1" \ "New layout does not contain the \"cmd\" window" -# Avoid unbalanced curly braces problems with tcl 8.5. -if { [tcl_version_at_least 8 6] } { - gdb_test "tui new-layout example src 1\}" \ - "Extra '\}' in layout specification" - gdb_test "tui new-layout example {src 1} 1\}" \ - "Extra '\}' in layout specification" - gdb_test "tui new-layout example \{src 1" \ - "Missing '\}' in layout specification" -} +gdb_test "tui new-layout example src 1\}" \ + "Extra '\}' in layout specification" +gdb_test "tui new-layout example {src 1} 1\}" \ + "Extra '\}' in layout specification" +gdb_test "tui new-layout example \{src 1" \ + "Missing '\}' in layout specification" # Each entry of this list describes a layout, and some associated # tests. The items within each entry are: diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b5092c6..930462f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -15,7 +15,7 @@ # This file was written by Fred Fish. (fnf@cygnus.com) -package require Tcl 8.5 +package require Tcl 8.6.2 # Generic gdb subroutines that should work for any target. If these # need to be modified for any target, it can be done with a variable @@ -1685,44 +1685,6 @@ proc tcl_version_at_least { major minor {patchlevel 0} } { return [expr {[package vcompare $current_version $min_version] >= 0}] } -if { [tcl_version_at_least 8 6] == 0 } { - # lmap was added in tcl 8.6. Only add if missing. - - # Note that we only implement the simple variant for now. - proc lmap { varname list body } { - set res {} - foreach val $list { - uplevel 1 "set $varname $val" - lappend res [uplevel 1 $body] - } - - return $res - } - - # ::tcl_platform(pathSeparator) was added in 8.6. - switch $::tcl_platform(platform) { - windows { - set ::tcl_platform(pathSeparator) ; - } - default { - set ::tcl_platform(pathSeparator) : - } - } -} - -if { [tcl_version_at_least 8 6 2] == 0 } { - # string cat was added in tcl 8.6.2. Only add if missing. - - rename string tcl_proc_string - - proc string { what args } { - if { $what == "cat" } { - return [join $args ""] - } - return [tcl_proc_string $what {*}$args] - } -} - # gdb_test_no_output [-prompt PROMPT_REGEXP] [-nopass] COMMAND [MESSAGE] # Send a command to GDB and verify that this command generated no output. # @@ -3029,11 +2991,6 @@ gdb_caching_proc allow_dap_tests {} { return 0 } - # ton.tcl uses "string is entier", supported starting tcl 8.6. - if { ![tcl_version_at_least 8 6] } { - return 0 - } - # With set auto-connect-native-target off, we run into: # +++ run # Traceback (most recent call last): -- cgit v1.1