@@ -37,7 +37,7 @@ use walkdir::WalkDir;
37
37
38
38
use self :: header:: { EarlyProps , make_test_description} ;
39
39
use 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,
41
41
output_base_dir, output_relative_path,
42
42
} ;
43
43
use crate :: header:: HeadersCache ;
@@ -183,7 +183,13 @@ pub fn parse_config(args: Vec<String>) -> Config {
183
183
"What custom diff tool to use for displaying compiletest tests." ,
184
184
"COMMAND" ,
185
185
)
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
+ ) ;
187
193
188
194
let ( argv0, args_) = args. split_first ( ) . unwrap ( ) ;
189
195
if args. len ( ) == 1 || args[ 1 ] == "-h" || args[ 1 ] == "--help" {
@@ -302,7 +308,11 @@ pub fn parse_config(args: Vec<String>) -> Config {
302
308
stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
303
309
mode,
304
310
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
+ } ) ,
306
316
run_ignored,
307
317
with_rustc_debug_assertions,
308
318
with_std_debug_assertions,
@@ -475,9 +485,16 @@ pub fn run_tests(config: Arc<Config>) {
475
485
if let Mode :: DebugInfo = config. mode {
476
486
// Debugging emscripten code doesn't make sense today
477
487
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
+ }
481
498
}
482
499
} else {
483
500
configs. push ( config. clone ( ) ) ;
0 commit comments