Skip to content

Commit 5757e05

Browse files
committed
Fix backtrace on Redox
1 parent b2c0707 commit 5757e05

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/libstd/sys/redox/backtrace.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use libc;
1211
use io;
1312
use sys_common::backtrace::Frame;
1413

15-
pub use sys_common::gnu::libbacktrace::*;
14+
pub use sys_common::gnu::libbacktrace::{foreach_symbol_fileline, resolve_symname};
1615
pub struct BacktraceContext;
1716

1817
#[inline(never)]
19-
pub fn unwind_backtrace(frames: &mut [Frame])
18+
pub fn unwind_backtrace(_frames: &mut [Frame])
2019
-> io::Result<(usize, BacktraceContext)>
2120
{
2221
Ok((0, BacktraceContext))
2322
}
23+
24+
pub mod gnu {
25+
use io;
26+
use fs;
27+
use libc::c_char;
28+
29+
pub fn get_executable_filename() -> io::Result<(Vec<c_char>, fs::File)> {
30+
Err(io::Error::new(io::ErrorKind::Other, "Not implemented"))
31+
}
32+
}

src/libstd/sys_common/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ pub mod net;
5252

5353
#[cfg(feature = "backtrace")]
5454
#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
55-
all(windows, target_env = "gnu")))]
55+
all(windows, target_env = "gnu"),
56+
target_os = "redox"))]
5657
pub mod gnu;
5758

5859
// common error constructors

0 commit comments

Comments
 (0)