@@ -37,7 +37,7 @@ use walkdir::WalkDir;
3737
3838use self :: header:: { EarlyProps , make_test_description} ;
3939use crate :: common:: {
40- CompareMode , Config , Mode , PassMode , TestPaths , UI_EXTENSIONS , expected_output_path,
40+ CompareMode , Config , Debugger , Mode , PassMode , TestPaths , UI_EXTENSIONS , expected_output_path,
4141 output_base_dir, output_relative_path,
4242} ;
4343use crate :: header:: HeadersCache ;
@@ -183,7 +183,13 @@ pub fn parse_config(args: Vec<String>) -> Config {
183183 "What custom diff tool to use for displaying compiletest tests." ,
184184 "COMMAND" ,
185185 )
186- . reqopt ( "" , "minicore-path" , "path to minicore aux library" , "PATH" ) ;
186+ . reqopt ( "" , "minicore-path" , "path to minicore aux library" , "PATH" )
187+ . optopt (
188+ "" ,
189+ "debugger" ,
190+ "only test a specific debugger in debuginfo tests" ,
191+ "gdb | lldb | cdb" ,
192+ ) ;
187193
188194 let ( argv0, args_) = args. split_first ( ) . unwrap ( ) ;
189195 if args. len ( ) == 1 || args[ 1 ] == "-h" || args[ 1 ] == "--help" {
@@ -302,7 +308,11 @@ pub fn parse_config(args: Vec<String>) -> Config {
302308 stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
303309 mode,
304310 suite : matches. opt_str ( "suite" ) . unwrap ( ) ,
305- debugger : None ,
311+ debugger : matches. opt_str ( "debugger" ) . map ( |debugger| {
312+ debugger
313+ . parse :: < Debugger > ( )
314+ . unwrap_or_else ( |_| panic ! ( "unknown `--debugger` option `{debugger}` given" ) )
315+ } ) ,
306316 run_ignored,
307317 with_rustc_debug_assertions,
308318 with_std_debug_assertions,
@@ -475,9 +485,16 @@ pub fn run_tests(config: Arc<Config>) {
475485 if let Mode :: DebugInfo = config. mode {
476486 // Debugging emscripten code doesn't make sense today
477487 if !config. target . contains ( "emscripten" ) {
478- configs. extend ( debuggers:: configure_cdb ( & config) ) ;
479- configs. extend ( debuggers:: configure_gdb ( & config) ) ;
480- configs. extend ( debuggers:: configure_lldb ( & config) ) ;
488+ match config. debugger {
489+ Some ( Debugger :: Cdb ) => configs. extend ( debuggers:: configure_cdb ( & config) ) ,
490+ Some ( Debugger :: Gdb ) => configs. extend ( debuggers:: configure_gdb ( & config) ) ,
491+ Some ( Debugger :: Lldb ) => configs. extend ( debuggers:: configure_lldb ( & config) ) ,
492+ None => {
493+ configs. extend ( debuggers:: configure_cdb ( & config) ) ;
494+ configs. extend ( debuggers:: configure_gdb ( & config) ) ;
495+ configs. extend ( debuggers:: configure_lldb ( & config) ) ;
496+ }
497+ }
481498 }
482499 } else {
483500 configs. push ( config. clone ( ) ) ;
0 commit comments