From: Jan Kratochvil Date: Wed, 25 Jul 2012 20:17:59 +0000 (+0000) Subject: gdb/testsuite/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9cc8e32c67048524f87488aec68cee059c242613;p=binutils-gdb.git gdb/testsuite/ Fix compatibility with Tcl before 7.5. * lib/future.exp (lreverse): New function if it does not exist. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6988348b2ba..b0d8411a7d9 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-25 Jan Kratochvil + + Fix compatibility with Tcl before 7.5. + * lib/future.exp (lreverse): New function if it does not exist. + 2012-07-25 Marc Khouzam * gdb.mi/mi-pending.c: New method to set a second pending diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index bf47988d0b3..226a690682d 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -521,3 +521,16 @@ if {$use_gdb_compile} { catch {rename default_target_compile {}} rename gdb_default_target_compile default_target_compile } + + +# Provide 'lreverse' missing in Tcl before 7.5. + +if {[info procs lreverse] == ""} { + proc lreverse { arg } { + set retval {} + while { [llength $retval] < [llength $arg] } { + lappend retval [lindex $arg end-[llength $retval]] + } + return $retval + } +}