aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorRob Savoye <rob@cygnus>1993-08-30 23:12:28 +0000
committerRob Savoye <rob@cygnus>1993-08-30 23:12:28 +0000
commit5019a2755a097da861620fe857cf343442889cd5 (patch)
treec6208373c0ddc5621ecaa83a36eaf9de8d59d3e9 /gdb/testsuite/lib
parentc79f61db34bcaaec6538703730d43b280762dc39 (diff)
downloadgdb-5019a2755a097da861620fe857cf343442889cd5.zip
gdb-5019a2755a097da861620fe857cf343442889cd5.tar.gz
gdb-5019a2755a097da861620fe857cf343442889cd5.tar.bz2
Add default gdb version so it can be shared.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 880ff0f..1518c26 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -24,6 +24,22 @@
# 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
#