]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/lib/rust-support.exp
Implement Rust raw identifiers
[thirdparty/binutils-gdb.git] / gdb / testsuite / lib / rust-support.exp
index d2ffac94be321d48c005540175b6aa3dc6f3f307..2896ac82453655e4726320ee80dfc88f55474ffc 100644 (file)
@@ -54,3 +54,20 @@ gdb_caching_proc rust_llvm_version {
     }
     return 0.0
 }
+
+# Return the version of the Rust compiler.
+gdb_caching_proc rust_compiler_version {
+    set rustc [find_rustc]
+    if {$rustc == ""} {
+       verbose "could not find rustc"
+    } else {
+       set output [lindex [remote_exec host "$rustc --version --verbose"] 1]
+       foreach line [split $output \n] {
+           if {[regexp "rustc (\[0-9.\]+) .*\$" $output ignore version]} {
+               return $version
+           }
+       }
+       verbose "could not match rustc version output: $output"
+    }
+    return 0.0
+}