diff options
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b59b435..9d711e8 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1516,6 +1516,21 @@ if { [tcl_version_at_least 8 5] == 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 + } +} + # gdb_test_no_output [-prompt PROMPT_REGEXP] [-nopass] COMMAND [MESSAGE] # Send a command to GDB and verify that this command generated no output. # |