Skip to content

Commit acf3b36

Browse files
committed
---
yaml --- r: 187892 b: refs/heads/tmp c: ff678ea h: refs/heads/master v: v3
1 parent 790db5e commit acf3b36

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 587f10aa36a1fcab73c6012125f6a3a9a8104412
37+
refs/heads/tmp: ff678ea3f4f0e0ec2fd552db57d57889470ee7f5
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/libstd/sys/unix/backtrace.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
224224

225225
#[cfg(any(target_os = "macos", target_os = "ios"))]
226226
fn print(w: &mut Writer, idx: int, addr: *mut libc::c_void,
227-
symaddr: *mut libc::c_void) -> IoResult<()> {
227+
_symaddr: *mut libc::c_void) -> IoResult<()> {
228228
use intrinsics;
229229
#[repr(C)]
230230
struct Dl_info {
@@ -450,6 +450,7 @@ fn output(w: &mut Writer, idx: int, addr: *mut libc::c_void,
450450
w.write_all(&['\n' as u8])
451451
}
452452

453+
#[allow(dead_code)]
453454
fn output_fileline(w: &mut Writer, file: &[u8], line: libc::c_int,
454455
more: bool) -> IoResult<()> {
455456
let file = str::from_utf8(file).ok().unwrap_or("<unknown>");

branches/tmp/src/test/run-pass/backtrace-debuginfo.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// compile-flags:-g
12+
// ignore-pretty as this critically relies on line numbers
1213

1314
use std::old_io::stderr;
1415
use std::env;
@@ -19,14 +20,35 @@ macro_rules! pos {
1920
() => ((file!(), line!()))
2021
}
2122

23+
#[cfg(all(unix,
24+
not(target_os = "macos"),
25+
not(target_os = "ios"),
26+
not(target_os = "android"),
27+
not(all(target_os = "linux", target_arch = "arm"))))]
28+
macro_rules! dump_and_die {
29+
($($pos:expr),*) => ({
30+
// FIXME(#18285): we cannot include the current position because
31+
// the macro span takes over the last frame's file/line.
32+
dump_filelines(&[$($pos),*]);
33+
panic!();
34+
})
35+
}
36+
37+
// this does not work on Windows, Android, OSX or iOS
38+
#[cfg(any(not(unix),
39+
target_os = "macos",
40+
target_os = "ios",
41+
target_os = "android",
42+
all(target_os = "linux", target_arch = "arm")))]
43+
macro_rules! dump_and_die {
44+
($($pos:expr),*) => ({ let _ = [$($pos),*]; })
45+
}
46+
2247
// we can't use a function as it will alter the backtrace
2348
macro_rules! check {
2449
($counter:expr; $($pos:expr),*) => ({
2550
if *$counter == 0 {
26-
// FIXME(#18285): we cannot include the current position because
27-
// the macro span takes over the last frame's file/line.
28-
dump_filelines(&[$($pos),*]);
29-
panic!();
51+
dump_and_die!($($pos),*)
3052
} else {
3153
*$counter -= 1;
3254
}

0 commit comments

Comments
 (0)