Skip to content
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

Rollup of 17 pull requests #42105

Merged
merged 46 commits into from
May 19, 2017
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
db16ca7
Update documention in windows::ffi
randomPoison May 6, 2017
e406cd1
Update documentation in windows::ffi
randomPoison May 6, 2017
d7df6dc
Merge remote-tracking branch 'rust-lang/master' into iss29367-windows…
randomPoison May 6, 2017
76128b3
Update documentation in windows::fs
randomPoison May 7, 2017
c350bc1
Fix documentation tests in windows::fs
randomPoison May 7, 2017
5135cc8
Fix tidy errors
randomPoison May 10, 2017
e6cde9f
Number of filtered out tests in tests summary
mersinvald May 11, 2017
94d2c43
add -Z pre-link-arg{,s} to rustc
japaric May 13, 2017
4f2f270
Fix regression on `include!(line!())`.
jseyfried May 15, 2017
1b6a182
Improve the error management when /proc is not mounted
sylvestre May 17, 2017
307d8e5
ci: allows shared scripts
malbarbo May 12, 2017
b955296
misc doc improvements for std::env
tshepang May 17, 2017
f4e33a0
fix typo in libstd/sync/mpsc/mod.rs docs
seeekr May 18, 2017
1eb6639
Make documentation works again by removing two unnecessary ES6 pieces.
pravic May 18, 2017
474cc91
Use in-memory representation for Fingerprint that is more amenable to…
michaelwoerister May 17, 2017
4549423
Use 128 instead of 64 bits for DefPath hashes
michaelwoerister May 18, 2017
b2fc7b1
Add documentation for `ExitStatus`
citizen428 May 11, 2017
d15c950
ci: move shared scripts to src/ci/docker/scripts/
malbarbo May 18, 2017
502eadb
ci: add filesystem layout docs
malbarbo May 18, 2017
ecfdc9a
rustbuild: install rust-analysis and rust-src when extended build is …
Keruspe May 17, 2017
801e2b7
rustbuild: refactor install
Keruspe May 18, 2017
c5163aa
Fix x.py
nagisa May 18, 2017
9b184c0
ci: fix dist-powerpc-linux image
malbarbo May 18, 2017
e86588e
Give a nicer error for non-Unicode arguments to rustc and rustdoc
cuviper May 18, 2017
e48086c
rustdoc: Fix implementors list javascript
ollie27 May 19, 2017
4cd838b
Normalize docs in windows::ffi and windows::fs
randomPoison May 19, 2017
41debc3
Try to optimise char patterns
nagisa May 15, 2017
b5acbd3
debuginfo: Generate unique DW_AT_names for compilation units to work …
michaelwoerister May 19, 2017
a892925
Fix doc test failure for OpenOptionsExt
randomPoison May 19, 2017
d7a5390
Rollup merge of #41870 - excaliburHisSheath:iss29367-windows-docs, r=…
Mark-Simulacrum May 19, 2017
d8d2db2
Rollup merge of #41910 - mersinvald:master, r=Mark-Simulacrum
Mark-Simulacrum May 19, 2017
04b0779
Rollup merge of #41958 - malbarbo:docker-share, r=alexcrichton
Mark-Simulacrum May 19, 2017
8292136
Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichton
Mark-Simulacrum May 19, 2017
8b93680
Rollup merge of #42006 - jseyfried:fix_include_regression, r=nrc
Mark-Simulacrum May 19, 2017
862e7d4
Rollup merge of #42024 - citizen428:docs/update-exitstatus, r=stevekl…
Mark-Simulacrum May 19, 2017
db01c94
Rollup merge of #42037 - nagisa:charpat, r=sfackler
Mark-Simulacrum May 19, 2017
0011828
Rollup merge of #42056 - sylvestre:master, r=alexcrichton
Mark-Simulacrum May 19, 2017
abd1a00
Rollup merge of #42067 - Keruspe:master, r=alexcrichton
Mark-Simulacrum May 19, 2017
6a2bf05
Rollup merge of #42070 - tshepang:env-misc, r=BurntSushi
Mark-Simulacrum May 19, 2017
4c2273a
Rollup merge of #42079 - seeekr:patch-1, r=steveklabnik
Mark-Simulacrum May 19, 2017
f3b7b61
Rollup merge of #42080 - pravic:jquery-removal-fix, r=frewsxcv
Mark-Simulacrum May 19, 2017
3fb27a0
Rollup merge of #42082 - michaelwoerister:wider_def_path_hashes, r=eddyb
Mark-Simulacrum May 19, 2017
7812adf
Rollup merge of #42089 - nagisa:xpy-broke-on-py3-again⁈, r=alexcrichton
Mark-Simulacrum May 19, 2017
fd8ca3e
Rollup merge of #42092 - cuviper:args_os, r=Mark-Simulacrum
Mark-Simulacrum May 19, 2017
5ded76c
Rollup merge of #42096 - ollie27:rustdoc_js_impls, r=GuillaumeGomez
Mark-Simulacrum May 19, 2017
040cd6d
Rollup merge of #42100 - michaelwoerister:fix-osx-multi-cgu-debuginfo…
Mark-Simulacrum May 19, 2017
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
5 changes: 4 additions & 1 deletion src/librustc_trans/context.rs
Original file line number Diff line number Diff line change
@@ -375,7 +375,10 @@ impl<'a, 'tcx> LocalCrateContext<'a, 'tcx> {

let dbg_cx = if shared.tcx.sess.opts.debuginfo != NoDebugInfo {
let dctx = debuginfo::CrateDebugContext::new(llmod);
debuginfo::metadata::compile_unit_metadata(shared, &dctx, shared.tcx.sess);
debuginfo::metadata::compile_unit_metadata(shared,
codegen_unit.name(),
&dctx,
shared.tcx.sess);
Some(dctx)
} else {
None
29 changes: 16 additions & 13 deletions src/librustc_trans/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
@@ -762,31 +762,38 @@ fn pointer_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
}

pub fn compile_unit_metadata(scc: &SharedCrateContext,
codegen_unit_name: &str,
debug_context: &CrateDebugContext,
sess: &Session)
-> DIDescriptor {
let compile_unit_name = match sess.local_crate_source_file {
None => fallback_path(scc),
Some(ref path) => {
CString::new(&path[..]).unwrap()
}
let mut name_in_debuginfo = match sess.local_crate_source_file {
Some(ref path) => path.clone(),
None => scc.tcx().crate_name(LOCAL_CRATE).to_string(),
};

debug!("compile_unit_metadata: {:?}", compile_unit_name);
// The OSX linker has an idiosyncrasy where it will ignore some debuginfo
// if multiple object files with the same DW_AT_name are linked together.
// As a workaround we generate unique names for each object file. Those do
// not correspond to an actual source file but that should be harmless.
if scc.sess().target.target.options.is_like_osx {
name_in_debuginfo.push_str("@");
name_in_debuginfo.push_str(codegen_unit_name);
}

debug!("compile_unit_metadata: {:?}", name_in_debuginfo);
// FIXME(#41252) Remove "clang LLVM" if we can get GDB and LLVM to play nice.
let producer = format!("clang LLVM (rustc version {})",
(option_env!("CFG_VERSION")).expect("CFG_VERSION"));

let compile_unit_name = compile_unit_name.as_ptr();

let name_in_debuginfo = CString::new(name_in_debuginfo).unwrap();
let work_dir = CString::new(&sess.working_dir.0[..]).unwrap();
let producer = CString::new(producer).unwrap();
let flags = "\0";
let split_name = "\0";

unsafe {
let file_metadata = llvm::LLVMRustDIBuilderCreateFile(
debug_context.builder, compile_unit_name, work_dir.as_ptr());
debug_context.builder, name_in_debuginfo.as_ptr(), work_dir.as_ptr());

return llvm::LLVMRustDIBuilderCreateCompileUnit(
debug_context.builder,
@@ -798,10 +805,6 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
0,
split_name.as_ptr() as *const _)
};

fn fallback_path(scc: &SharedCrateContext) -> CString {
CString::new(scc.tcx().crate_name(LOCAL_CRATE).to_string()).unwrap()
}
}

struct MetadataCreationResult {
67 changes: 67 additions & 0 deletions src/test/debuginfo/multi-cgu.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


// This test case makes sure that we get proper break points for binaries
// compiled with multiple codegen units. (see #39160)


// min-lldb-version: 310

// compile-flags:-g -Ccodegen-units=2

// === GDB TESTS ===============================================================

// gdb-command:run

// gdb-command:print xxx
// gdb-check:$1 = 12345
// gdb-command:continue

// gdb-command:print yyy
// gdb-check:$2 = 67890
// gdb-command:continue


// === LLDB TESTS ==============================================================

// lldb-command:run

// lldb-command:print xxx
// lldb-check:[...]$0 = 12345
// lldb-command:continue

// lldb-command:print yyy
// lldb-check:[...]$1 = 67890
// lldb-command:continue


#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]

mod a {
pub fn foo(xxx: u32) {
super::_zzz(); // #break
}
}

mod b {
pub fn bar(yyy: u64) {
super::_zzz(); // #break
}
}

fn main() {
a::foo(12345);
b::bar(67890);
}

#[inline(never)]
fn _zzz() {}