@@ -18,6 +18,8 @@ use common::Config;
18
18
use common;
19
19
use util;
20
20
21
+ use extract_gdb_version;
22
+
21
23
/// Properties which must be known very early, before actually running
22
24
/// the test.
23
25
pub struct EarlyProps {
@@ -75,15 +77,15 @@ impl EarlyProps {
75
77
return true ;
76
78
}
77
79
78
- if let Some ( ref actual_version) = config. gdb_version {
80
+ if let Some ( actual_version) = config. gdb_version {
79
81
if line. contains ( "min-gdb-version" ) {
80
82
let min_version = line. trim ( )
81
83
. split ( ' ' )
82
84
. last ( )
83
85
. expect ( "Malformed GDB version directive" ) ;
84
86
// Ignore if actual version is smaller the minimum required
85
87
// version
86
- gdb_version_to_int ( actual_version) < gdb_version_to_int ( min_version)
88
+ actual_version < extract_gdb_version ( min_version) . unwrap ( )
87
89
} else {
88
90
false
89
91
}
@@ -464,23 +466,6 @@ pub fn parse_name_value_directive(line: &str, directive: &str) -> Option<String>
464
466
}
465
467
}
466
468
467
- pub fn gdb_version_to_int ( version_string : & str ) -> isize {
468
- let error_string = format ! ( "Encountered GDB version string with unexpected format: {}" ,
469
- version_string) ;
470
- let error_string = error_string;
471
-
472
- let components: Vec < & str > = version_string. trim ( ) . split ( '.' ) . collect ( ) ;
473
-
474
- if components. len ( ) != 2 {
475
- panic ! ( "{}" , error_string) ;
476
- }
477
-
478
- let major: isize = components[ 0 ] . parse ( ) . ok ( ) . expect ( & error_string) ;
479
- let minor: isize = components[ 1 ] . parse ( ) . ok ( ) . expect ( & error_string) ;
480
-
481
- return major * 1000 + minor;
482
- }
483
-
484
469
pub fn lldb_version_to_int ( version_string : & str ) -> isize {
485
470
let error_string = format ! ( "Encountered LLDB version string with unexpected format: {}" ,
486
471
version_string) ;
0 commit comments