--- /dev/null
+# Copyright 2024 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+gdb_assert { [string cat "foo" "bar"] == "foobar" }
<= [list $python_version_major $python_version_minor]]
}
-# Return 1 if tcl version used is at least MAJOR.MINOR
-proc tcl_version_at_least { major minor } {
- global tcl_version
- regexp {^([0-9]+)\.([0-9]+)$} $tcl_version \
- dummy tcl_version_major tcl_version_minor
- return [version_compare [list $major $minor] \
- <= [list $tcl_version_major $tcl_version_minor]]
+# Return 1 if tcl version used is at least MAJOR.MINOR.PATCHLEVEL.
+proc tcl_version_at_least { major minor {patchlevel 0} } {
+ global tcl_patchLevel
+ regexp {^([0-9]+)\.([0-9]+)\.([0-9]+)$} \
+ $tcl_patchLevel dummy \
+ tcl_version_major tcl_version_minor tcl_version_patchlevel
+ return \
+ [version_compare \
+ [list \
+ $major \
+ $minor \
+ $patchlevel] \
+ <= \
+ [list \
+ $tcl_version_major \
+ $tcl_version_minor \
+ $tcl_version_patchlevel]]
}
if { [tcl_version_at_least 8 5] == 0 } {
}
}
+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.
#