Skip to content

Commit 0e72c80

Browse files
committed
FIXME(9639) remove fixme and accept non-utf8 paths in compiletest
1 parent 957a9c7 commit 0e72c80

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use util::{logv, PathBufExt};
2727
use std::collections::hash_map::DefaultHasher;
2828
use std::collections::{HashMap, HashSet, VecDeque};
2929
use std::env;
30-
use std::ffi::OsString;
30+
use std::ffi::{OsStr, OsString};
3131
use std::fmt;
3232
use std::fs::{self, create_dir_all, File};
3333
use std::hash::{Hash, Hasher};
@@ -760,13 +760,13 @@ impl<'test> TestCx<'test> {
760760
}
761761
drop(stdout);
762762

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,
770770
];
771771

772772
let gdb_path = self.config.gdb.as_ref().unwrap();
@@ -775,12 +775,12 @@ impl<'test> TestCx<'test> {
775775
stdout,
776776
stderr,
777777
} = Command::new(&gdb_path)
778-
.args(&debugger_opts)
778+
.args(debugger_opts)
779779
.output()
780780
.expect(&format!("failed to exec `{:?}`", gdb_path));
781781
let cmdline = {
782782
let mut gdb = Command::new(&format!("{}-gdb", self.config.target));
783-
gdb.args(&debugger_opts);
783+
gdb.args(debugger_opts);
784784
let cmdline = self.make_cmdline(&gdb, "");
785785
logv(self.config, format!("executing {}", cmdline));
786786
cmdline
@@ -868,18 +868,18 @@ impl<'test> TestCx<'test> {
868868
debug!("script_str = {}", script_str);
869869
self.dump_output_file(&script_str, "debugger.script");
870870

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"));
872873

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,
879879
];
880880

881881
let mut gdb = Command::new(self.config.gdb.as_ref().unwrap());
882-
gdb.args(&debugger_opts)
882+
gdb.args(debugger_opts)
883883
.env("PYTHONPATH", rust_pp_module_abs_path);
884884

885885
debugger_run_result = self.compose_and_run(

0 commit comments

Comments
 (0)