From: Rob Savoye Date: Mon, 30 Aug 1993 23:12:28 +0000 (+0000) Subject: Add default gdb version so it can be shared. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5019a2755a097da861620fe857cf343442889cd5;p=binutils-gdb.git Add default gdb version so it can be shared. --- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 880ff0f8d6c..1518c26e320 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -23,6 +23,22 @@ # need to be modified for any target, it can be done with a variable # or by passing arguments. +# +# gdb_version -- extract and print the version number of gcc +# +proc default_gdb_version {} { + global GDB + global GDBFLAGS + if {[which $GDB] != 0} then { + set tmp [exec echo "q" | $GDB] + set version "[lindex $tmp [lsearch $tmp "\[0-9\]*"]]" + set version "[string range $version 0 [expr [string length $version]-2]]" + clone_output "[which $GDB] version $version $GDBFLAGS\n" + } else { + warning "$GDB does not exist" + } +} + # # gdb_unload -- unload a file if one is loaded #