@@ -430,11 +430,23 @@ actual:\n\
430
430
}
431
431
432
432
fn run_debuginfo_gdb_test_no_opt ( & self ) {
433
+ let prefixes = if self . config . gdb_native_rust {
434
+ // GDB with Rust
435
+ static PREFIXES : & ' static [ & ' static str ] = & [ "gdb" , "gdbr" ] ;
436
+ println ! ( "NOTE: compiletest thinks it is using GDB with native rust support" ) ;
437
+ PREFIXES
438
+ } else {
439
+ // Generic GDB
440
+ static PREFIXES : & ' static [ & ' static str ] = & [ "gdb" , "gdbg" ] ;
441
+ println ! ( "NOTE: compiletest thinks it is using GDB without native rust support" ) ;
442
+ PREFIXES
443
+ } ;
444
+
433
445
let DebuggerCommands {
434
446
commands,
435
447
check_lines,
436
448
breakpoint_lines
437
- } = self . parse_debugger_commands ( "gdb" ) ;
449
+ } = self . parse_debugger_commands ( prefixes ) ;
438
450
let mut cmds = commands. join ( "\n " ) ;
439
451
440
452
// compile test file (it should have 'compile-flags:-g' in the header)
@@ -731,7 +743,7 @@ actual:\n\
731
743
check_lines,
732
744
breakpoint_lines,
733
745
..
734
- } = self . parse_debugger_commands ( "lldb" ) ;
746
+ } = self . parse_debugger_commands ( & [ "lldb" ] ) ;
735
747
736
748
// Write debugger script:
737
749
// We don't want to hang when calling `quit` while the process is still running
@@ -826,9 +838,11 @@ actual:\n\
826
838
}
827
839
}
828
840
829
- fn parse_debugger_commands ( & self , debugger_prefix : & str ) -> DebuggerCommands {
830
- let command_directive = format ! ( "{}-command" , debugger_prefix) ;
831
- let check_directive = format ! ( "{}-check" , debugger_prefix) ;
841
+ fn parse_debugger_commands ( & self , debugger_prefixes : & [ & str ] ) -> DebuggerCommands {
842
+ let directives = debugger_prefixes. iter ( ) . map ( |prefix| (
843
+ format ! ( "{}-command" , prefix) ,
844
+ format ! ( "{}-check" , prefix) ,
845
+ ) ) . collect :: < Vec < _ > > ( ) ;
832
846
833
847
let mut breakpoint_lines = vec ! ( ) ;
834
848
let mut commands = vec ! ( ) ;
@@ -842,17 +856,19 @@ actual:\n\
842
856
breakpoint_lines. push ( counter) ;
843
857
}
844
858
845
- header:: parse_name_value_directive (
846
- & line,
847
- & command_directive) . map ( |cmd| {
848
- commands. push ( cmd)
849
- } ) ;
850
-
851
- header:: parse_name_value_directive (
852
- & line,
853
- & check_directive) . map ( |cmd| {
854
- check_lines. push ( cmd)
855
- } ) ;
859
+ for & ( ref command_directive, ref check_directive) in & directives {
860
+ header:: parse_name_value_directive (
861
+ & line,
862
+ & command_directive) . map ( |cmd| {
863
+ commands. push ( cmd)
864
+ } ) ;
865
+
866
+ header:: parse_name_value_directive (
867
+ & line,
868
+ & check_directive) . map ( |cmd| {
869
+ check_lines. push ( cmd)
870
+ } ) ;
871
+ }
856
872
}
857
873
Err ( e) => {
858
874
self . fatal ( & format ! ( "Error while parsing debugger commands: {}" , e) )
0 commit comments