@@ -29,7 +29,7 @@ use crate::core::builder::{
2929} ;
3030use crate :: core:: config:: TargetSelection ;
3131use crate :: core:: config:: flags:: { Subcommand , get_completion, top_level_help} ;
32- use crate :: core:: debuggers;
32+ use crate :: core:: { android , debuggers} ;
3333use crate :: utils:: build_stamp:: { self , BuildStamp } ;
3434use crate :: utils:: exec:: { BootstrapCommand , command} ;
3535use crate :: utils:: helpers:: {
@@ -2114,21 +2114,18 @@ Please disable assertions with `rust.debug-assertions = false`.
21142114 builder. config . python . as_ref ( ) . expect ( "python is required for running rustdoc tests" ) ,
21152115 ) ;
21162116
2117- // FIXME(#148099): Currently we set these Android-related flags in all
2118- // modes, even though they should only be needed in "debuginfo" mode,
2119- // because the GDB-discovery code in compiletest currently assumes that
2120- // `--android-cross-path` is always set for Android targets.
2121- if let Some ( debuggers:: Android { adb_path, adb_test_dir, android_cross_path } ) =
2122- debuggers:: discover_android ( builder, target)
2123- {
2117+ // Discover and set some flags related to running tests on Android targets.
2118+ let android = android:: discover_android ( builder, target) ;
2119+ if let Some ( android:: Android { adb_path, adb_test_dir, android_cross_path } ) = & android {
21242120 cmd. arg ( "--adb-path" ) . arg ( adb_path) ;
21252121 cmd. arg ( "--adb-test-dir" ) . arg ( adb_test_dir) ;
21262122 cmd. arg ( "--android-cross-path" ) . arg ( android_cross_path) ;
21272123 }
21282124
21292125 if mode == "debuginfo" {
2130- if let Some ( debuggers:: Gdb { gdb } ) = debuggers:: discover_gdb ( builder) {
2131- cmd. arg ( "--gdb" ) . arg ( gdb) ;
2126+ if let Some ( debuggers:: Gdb { gdb } ) = debuggers:: discover_gdb ( builder, android. as_ref ( ) )
2127+ {
2128+ cmd. arg ( "--gdb" ) . arg ( gdb. as_ref ( ) ) ;
21322129 }
21332130
21342131 if let Some ( debuggers:: Lldb { lldb_exe, lldb_version } ) =
0 commit comments