Skip to content

Fix debuginfo tests #17161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ tidy:
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)echo $(ALL_HS) \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src -type f -perm +111 \
$(Q)find $(S)src -type f -perm a+x \
-not -name '*.rs' -and -not -name '*.py' \
-and -not -name '*.sh' \
| grep '^$(S)src/jemalloc' -v \
Expand Down
6 changes: 3 additions & 3 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make these r"\", r"\\" to avoid the escaping if you want.

.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());
}
}
Expand All @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,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.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down