]>
git.proxmox.com Git - rustc.git/blob - src/libstd/sys/unix/backtrace/printing/mod.rs
1 // Copyright 2014-2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 use sys
::backtrace
::BacktraceContext
;
14 use sys_common
::backtrace
::Frame
;
17 #[cfg(target_os = "emscripten")]
18 pub use self::dladdr
::resolve_symname
;
20 #[cfg(target_os = "emscripten")]
21 pub fn foreach_symbol_fileline
<F
>(_
: Frame
, _
: F
, _
: &BacktraceContext
) -> io
::Result
<bool
>
23 F
: FnMut(&[u8], u32) -> io
::Result
<()>
28 #[cfg(not(target_os = "emscripten"))]
29 pub use sys_common
::gnu
::libbacktrace
::foreach_symbol_fileline
;
31 #[cfg(not(target_os = "emscripten"))]
32 pub fn resolve_symname
<F
>(frame
: Frame
, callback
: F
, bc
: &BacktraceContext
) -> io
::Result
<()>
34 F
: FnOnce(Option
<&str>) -> io
::Result
<()>
36 ::sys_common
::gnu
::libbacktrace
::resolve_symname(frame
, |symname
| {
37 if symname
.is_some() {
40 dladdr
::resolve_symname(frame
, callback
, bc
)