@@ -18,6 +18,8 @@ use common::Config;
1818use common;
1919use util;
2020
21+ use extract_gdb_version;
22+
2123/// Properties which must be known very early, before actually running
2224/// the test.
2325pub struct EarlyProps {
@@ -75,15 +77,15 @@ impl EarlyProps {
7577 return true ;
7678 }
7779
78- if let Some ( ref actual_version) = config. gdb_version {
80+ if let Some ( actual_version) = config. gdb_version {
7981 if line. contains ( "min-gdb-version" ) {
8082 let min_version = line. trim ( )
8183 . split ( ' ' )
8284 . last ( )
8385 . expect ( "Malformed GDB version directive" ) ;
8486 // Ignore if actual version is smaller the minimum required
8587 // version
86- gdb_version_to_int ( actual_version) < gdb_version_to_int ( min_version)
88+ actual_version < extract_gdb_version ( min_version) . unwrap ( )
8789 } else {
8890 false
8991 }
@@ -464,23 +466,6 @@ pub fn parse_name_value_directive(line: &str, directive: &str) -> Option<String>
464466 }
465467}
466468
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-
484469pub fn lldb_version_to_int ( version_string : & str ) -> isize {
485470 let error_string = format ! ( "Encountered LLDB version string with unexpected format: {}" ,
486471 version_string) ;
0 commit comments