Skip to content

Commit 127c75e

Browse files
committed
Escape backslashes in debugger scripts.
1 parent 792a2ea commit 127c75e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiletest/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
482482
// GDB's script auto loading safe path ...
483483
script_str.push_str(
484484
format!("add-auto-load-safe-path {}\n",
485-
rust_pp_module_abs_path.as_slice())
485+
rust_pp_module_abs_path.replace("\\", "\\\\").as_slice())
486486
.as_slice());
487487
// ... and also the test directory
488488
script_str.push_str(
489489
format!("add-auto-load-safe-path {}\n",
490-
config.build_base.as_str().unwrap())
490+
config.build_base.as_str().unwrap().replace("\\", "\\\\"))
491491
.as_slice());
492492
}
493493
}
@@ -499,7 +499,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
499499

500500
// Load the target executable
501501
script_str.push_str(format!("file {}\n",
502-
exe_file.as_str().unwrap())
502+
exe_file.as_str().unwrap().replace("\\", "\\\\"))
503503
.as_slice());
504504

505505
script_str.push_str(cmds.as_slice());

0 commit comments

Comments
 (0)