Skip to content

Commit

Permalink
Rollup merge of #83532 - asomers:gdb-fbsd, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Fix compiletest on FreeBSD

Recent FreeBSD gdb packages have a different format for the version string.
  • Loading branch information
Dylan-DPC committed Apr 4, 2021
2 parents 7124e29 + 4f73d21 commit b8b47eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
// This particular form is documented in the GNU coding standards:
// https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion

let mut splits = full_version_line.rsplit(' ');
let unbracketed_part = full_version_line.split('[').next().unwrap();
let mut splits = unbracketed_part.trim_end().rsplit(' ');
let version_string = splits.next().unwrap();

let mut splits = version_string.split('.');
Expand Down
3 changes: 3 additions & 0 deletions src/tools/compiletest/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ fn test_extract_gdb_version() {
7012000: "GNU gdb (GDB) 7.12",
7012000: "GNU gdb (GDB) 7.12.20161027-git",
7012050: "GNU gdb (GDB) 7.12.50.20161027-git",

9002000: "GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2",
10001000: "GNU gdb (GDB) 10.1 [GDB v10.1 for FreeBSD]",
}
}

Expand Down

0 comments on commit b8b47eb

Please sign in to comment.