about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-13 17:25:54 +0000
committerbors <bors@rust-lang.org>2014-09-13 17:25:54 +0000
commit7277fe9ee790a5f2fe2131b62a21537ac04e4cfd (patch)
tree614a324d9161e667b47d99faec26f4bae00189b6 /src
parent079951ed2a0d11c9ccfb8023cc1a645a883f890f (diff)
parentd08441b9d67c791ea233632552ea47c0795498ec (diff)
downloadrust-7277fe9ee790a5f2fe2131b62a21537ac04e4cfd.tar.gz
rust-7277fe9ee790a5f2fe2131b62a21537ac04e4cfd.zip
auto merge of #17161 : vadimcn/rust/fix-debuginfo, r=alexcrichton
This PR fixes debuginfo tests on Windows.
Diffstat (limited to 'src')
-rw-r--r--src/compiletest/runtest.rs6
-rw-r--r--src/librustc/back/link.rs3
-rw-r--r--src/librustc/middle/trans/debuginfo.rs2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 32671722ba7..122a241ef0c 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -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());
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index e418284ffce..18aa66f0e93 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -1017,7 +1017,8 @@ fn link_args(cmd: &mut Command,
         cmd.arg("-Wl,--nxcompat");
 
         // Mark all dynamic libraries and executables as compatible with ASLR
-        cmd.arg("-Wl,--dynamicbase");
+        // FIXME #17098: ASLR breaks gdb
+        // cmd.arg("-Wl,--dynamicbase");
 
         // Mark all dynamic libraries and executables as compatible with the larger 4GiB address
         // space available to x86 Windows binaries on x86_64.
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index e1c7ef4d50f..f0b0507afbb 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -739,7 +739,7 @@ pub fn finalize(cx: &CrateContext) {
             cx.sess().targ_cfg.os == abi::OsiOS {
             "Dwarf Version".with_c_str(
                 |s| llvm::LLVMRustAddModuleFlag(cx.llmod(), s, 2));
-        } else {
+        } else if cx.sess().targ_cfg.os == abi::OsLinux {
             // FIXME(#13611) this is a kludge fix because the Linux bots have
             //               gdb 7.4 which doesn't understand dwarf4, we should
             //               do something more graceful here.