]> git.lizzy.rs Git - rust.git/commitdiff
Escape backslashes in debugger scripts.
authorVadim Chugunov <vadimcn@gmail.com>
Sun, 7 Sep 2014 20:19:33 +0000 (13:19 -0700)
committerVadim Chugunov <vadimcn@gmail.com>
Wed, 10 Sep 2014 23:52:22 +0000 (16:52 -0700)
src/compiletest/runtest.rs

index 32671722ba72872bbeaabe397ec5c193cd45ecfe..122a241ef0c7471fc24f2d8e43d345d4e9c42875 100644 (file)
@@ -482,12 +482,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
                         // GDB's script auto loading safe path ...
                         script_str.push_str(
                             format!("add-auto-load-safe-path {}\n",
-                                    rust_pp_module_abs_path.as_slice())
+                                    rust_pp_module_abs_path.replace("\\", "\\\\").as_slice())
                                 .as_slice());
                         // ... and also the test directory
                         script_str.push_str(
                             format!("add-auto-load-safe-path {}\n",
-                                    config.build_base.as_str().unwrap())
+                                    config.build_base.as_str().unwrap().replace("\\", "\\\\"))
                                 .as_slice());
                     }
                 }
@@ -499,7 +499,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
 
             // Load the target executable
             script_str.push_str(format!("file {}\n",
-                                        exe_file.as_str().unwrap())
+                                        exe_file.as_str().unwrap().replace("\\", "\\\\"))
                                     .as_slice());
 
             script_str.push_str(cmds.as_slice());