@@ -27,7 +27,7 @@ use util::{logv, PathBufExt};
27
27
use std:: collections:: hash_map:: DefaultHasher ;
28
28
use std:: collections:: { HashMap , HashSet , VecDeque } ;
29
29
use std:: env;
30
- use std:: ffi:: OsString ;
30
+ use std:: ffi:: { OsStr , OsString } ;
31
31
use std:: fmt;
32
32
use std:: fs:: { self , create_dir_all, File } ;
33
33
use std:: hash:: { Hash , Hasher } ;
@@ -760,13 +760,13 @@ impl<'test> TestCx<'test> {
760
760
}
761
761
drop ( stdout) ;
762
762
763
- let debugger_script = self . make_out_name ( "debugger.script ") ;
764
- // FIXME (#9639): This needs to handle non-utf8 paths
765
- let debugger_opts = vec ! [
766
- "-quiet" . to_owned ( ) ,
767
- "-batch" . to_owned ( ) ,
768
- "-nx" . to_owned ( ) ,
769
- format! ( "-command={}" , debugger_script. to_str ( ) . unwrap ( ) ) ,
763
+ let mut debugger_script = OsString :: from ( "-command= ") ;
764
+ debugger_script . push ( self . make_out_name ( "debugger.script" ) ) ;
765
+ let debugger_opts: & [ & OsStr ] = & [
766
+ "-quiet" . as_ref ( ) ,
767
+ "-batch" . as_ref ( ) ,
768
+ "-nx" . as_ref ( ) ,
769
+ & debugger_script,
770
770
] ;
771
771
772
772
let gdb_path = self . config . gdb . as_ref ( ) . unwrap ( ) ;
@@ -775,12 +775,12 @@ impl<'test> TestCx<'test> {
775
775
stdout,
776
776
stderr,
777
777
} = Command :: new ( & gdb_path)
778
- . args ( & debugger_opts)
778
+ . args ( debugger_opts)
779
779
. output ( )
780
780
. expect ( & format ! ( "failed to exec `{:?}`" , gdb_path) ) ;
781
781
let cmdline = {
782
782
let mut gdb = Command :: new ( & format ! ( "{}-gdb" , self . config. target) ) ;
783
- gdb. args ( & debugger_opts) ;
783
+ gdb. args ( debugger_opts) ;
784
784
let cmdline = self . make_cmdline ( & gdb, "" ) ;
785
785
logv ( self . config , format ! ( "executing {}" , cmdline) ) ;
786
786
cmdline
@@ -868,18 +868,18 @@ impl<'test> TestCx<'test> {
868
868
debug ! ( "script_str = {}" , script_str) ;
869
869
self . dump_output_file ( & script_str, "debugger.script" ) ;
870
870
871
- let debugger_script = self . make_out_name ( "debugger.script" ) ;
871
+ let mut debugger_script = OsString :: from ( "-command=" ) ;
872
+ debugger_script. push ( self . make_out_name ( "debugger.script" ) ) ;
872
873
873
- // FIXME (#9639): This needs to handle non-utf8 paths
874
- let debugger_opts = vec ! [
875
- "-quiet" . to_owned( ) ,
876
- "-batch" . to_owned( ) ,
877
- "-nx" . to_owned( ) ,
878
- format!( "-command={}" , debugger_script. to_str( ) . unwrap( ) ) ,
874
+ let debugger_opts: & [ & OsStr ] = & [
875
+ "-quiet" . as_ref ( ) ,
876
+ "-batch" . as_ref ( ) ,
877
+ "-nx" . as_ref ( ) ,
878
+ & debugger_script,
879
879
] ;
880
880
881
881
let mut gdb = Command :: new ( self . config . gdb . as_ref ( ) . unwrap ( ) ) ;
882
- gdb. args ( & debugger_opts)
882
+ gdb. args ( debugger_opts)
883
883
. env ( "PYTHONPATH" , rust_pp_module_abs_path) ;
884
884
885
885
debugger_run_result = self . compose_and_run (
0 commit comments