fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
match full_version_line {
- Some(full_version_line) => {
+ Some(ref full_version_line)
+ if full_version_line.as_slice().trim().len() > 0 => {
let full_version_line = full_version_line.as_slice().trim();
- let re = Regex::new(r"[^0-9]([0-9]\.[0-9])([^0-9]|$)").unwrap();
+
+ let re = Regex::new(r"(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)").unwrap();
match re.captures(full_version_line) {
Some(captures) => {
- Some(captures.at(1).to_string())
+ Some(captures.at(2).to_string())
+ }
+ None => {
+ println!("Could not extract GDB version from line '{}'",
+ full_version_line);
+ None
}
- None => None
}
},
- None => None
+ _ => None
}
}
\ No newline at end of file
match config.gdb_version {
Some(ref version) => {
+ println!("NOTE: compiletest thinks it is using GDB version {}",
+ version.as_slice());
+
if header::gdb_version_to_int(version.as_slice()) >
header::gdb_version_to_int("7.4") {
// Add the directory containing the pretty printers to
.as_slice());
}
}
- _ => { /* nothing to do */ }
+ _ => {
+ println!("NOTE: compiletest does not know which version of \
+ GDB it is using");
+ }
}
// Load the target executable