@@ -194,14 +194,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
194
194
let target = opt_str2 ( matches. opt_str ( "target" ) ) ;
195
195
let android_cross_path = opt_path ( matches, "android-cross-path" ) ;
196
196
let ( cdb, cdb_version) = analyze_cdb ( matches. opt_str ( "cdb" ) , & target) ;
197
- let ( gdb, gdb_version, gdb_native_rust) =
198
- analyze_gdb ( matches. opt_str ( "gdb" ) , & target, & android_cross_path) ;
199
- let ( lldb_version, lldb_native_rust) = matches
200
- . opt_str ( "lldb-version" )
201
- . as_deref ( )
202
- . and_then ( extract_lldb_version)
203
- . map ( |( v, b) | ( Some ( v) , b) )
204
- . unwrap_or ( ( None , false ) ) ;
197
+ let ( gdb, gdb_version) = analyze_gdb ( matches. opt_str ( "gdb" ) , & target, & android_cross_path) ;
198
+ let lldb_version = matches. opt_str ( "lldb-version" ) . as_deref ( ) . and_then ( extract_lldb_version) ;
205
199
let color = match matches. opt_str ( "color" ) . as_deref ( ) {
206
200
Some ( "auto" ) | None => ColorConfig :: AutoColor ,
207
201
Some ( "always" ) => ColorConfig :: AlwaysColor ,
@@ -298,9 +292,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
298
292
cdb_version,
299
293
gdb,
300
294
gdb_version,
301
- gdb_native_rust,
302
295
lldb_version,
303
- lldb_native_rust,
304
296
llvm_version,
305
297
system_llvm : matches. opt_present ( "system-llvm" ) ,
306
298
android_cross_path,
@@ -1035,19 +1027,17 @@ fn extract_cdb_version(full_version_line: &str) -> Option<[u16; 4]> {
1035
1027
Some ( [ major, minor, patch, build] )
1036
1028
}
1037
1029
1038
- /// Returns (Path to GDB, GDB Version, GDB has Rust Support )
1030
+ /// Returns (Path to GDB, GDB Version)
1039
1031
fn analyze_gdb (
1040
1032
gdb : Option < String > ,
1041
1033
target : & str ,
1042
1034
android_cross_path : & PathBuf ,
1043
- ) -> ( Option < String > , Option < u32 > , bool ) {
1035
+ ) -> ( Option < String > , Option < u32 > ) {
1044
1036
#[ cfg( not( windows) ) ]
1045
1037
const GDB_FALLBACK : & str = "gdb" ;
1046
1038
#[ cfg( windows) ]
1047
1039
const GDB_FALLBACK : & str = "gdb.exe" ;
1048
1040
1049
- const MIN_GDB_WITH_RUST : u32 = 7011010 ;
1050
-
1051
1041
let fallback_gdb = || {
1052
1042
if is_android_gdb_target ( target) {
1053
1043
let mut gdb_path = match android_cross_path. to_str ( ) {
@@ -1076,12 +1066,10 @@ fn analyze_gdb(
1076
1066
1077
1067
let version = match version_line {
1078
1068
Some ( line) => extract_gdb_version ( & line) ,
1079
- None => return ( None , None , false ) ,
1069
+ None => return ( None , None ) ,
1080
1070
} ;
1081
1071
1082
- let gdb_native_rust = version. map_or ( false , |v| v >= MIN_GDB_WITH_RUST ) ;
1083
-
1084
- ( Some ( gdb) , version, gdb_native_rust)
1072
+ ( Some ( gdb) , version)
1085
1073
}
1086
1074
1087
1075
fn extract_gdb_version ( full_version_line : & str ) -> Option < u32 > {
@@ -1131,8 +1119,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
1131
1119
Some ( ( ( major * 1000 ) + minor) * 1000 + patch)
1132
1120
}
1133
1121
1134
- /// Returns ( LLDB version, LLDB is rust-enabled)
1135
- fn extract_lldb_version ( full_version_line : & str ) -> Option < ( u32 , bool ) > {
1122
+ /// Returns LLDB version
1123
+ fn extract_lldb_version ( full_version_line : & str ) -> Option < u32 > {
1136
1124
// Extract the major LLDB version from the given version string.
1137
1125
// LLDB version strings are different for Apple and non-Apple platforms.
1138
1126
// The Apple variant looks like this:
@@ -1149,9 +1137,7 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
1149
1137
// There doesn't seem to be a way to correlate the Apple version
1150
1138
// with the upstream version, and since the tests were originally
1151
1139
// written against Apple versions, we make a fake Apple version by
1152
- // multiplying the first number by 100. This is a hack, but
1153
- // normally fine because the only non-Apple version we test is
1154
- // rust-enabled.
1140
+ // multiplying the first number by 100. This is a hack.
1155
1141
1156
1142
let full_version_line = full_version_line. trim ( ) ;
1157
1143
@@ -1160,12 +1146,12 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
1160
1146
{
1161
1147
if let Some ( idx) = apple_ver. find ( not_a_digit) {
1162
1148
let version: u32 = apple_ver[ ..idx] . parse ( ) . unwrap ( ) ;
1163
- return Some ( ( version, full_version_line . contains ( "rust-enabled" ) ) ) ;
1149
+ return Some ( version) ;
1164
1150
}
1165
1151
} else if let Some ( lldb_ver) = full_version_line. strip_prefix ( "lldb version " ) {
1166
1152
if let Some ( idx) = lldb_ver. find ( not_a_digit) {
1167
1153
let version: u32 = lldb_ver[ ..idx] . parse ( ) . ok ( ) ?;
1168
- return Some ( ( version * 100 , full_version_line . contains ( "rust-enabled" ) ) ) ;
1154
+ return Some ( version * 100 ) ;
1169
1155
}
1170
1156
}
1171
1157
None
0 commit comments