File tree 4 files changed +37
-27
lines changed
4 files changed +37
-27
lines changed Original file line number Diff line number Diff line change 3
3
use libc:: c_void;
4
4
use std:: path:: PathBuf ;
5
5
6
+ pub use crate :: platform:: TraceImpl ;
7
+
6
8
pub trait Symbol : Sized {
7
9
fn name ( & self ) -> Option < Vec < u8 > > ;
8
10
fn addr ( & self ) -> Option < * mut c_void > ;
@@ -43,25 +45,3 @@ pub trait Trace {
43
45
where
44
46
Self : Sized ;
45
47
}
46
-
47
- #[ cfg( not( all(
48
- any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
49
- feature = "frame-pointer"
50
- ) ) ) ]
51
- mod backtrace_rs;
52
- #[ cfg( not( all(
53
- any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
54
- feature = "frame-pointer"
55
- ) ) ) ]
56
- pub use backtrace_rs:: Trace as TraceImpl ;
57
-
58
- #[ cfg( all(
59
- any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
60
- feature = "frame-pointer"
61
- ) ) ]
62
- pub mod frame_pointer;
63
- #[ cfg( all(
64
- any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
65
- feature = "frame-pointer"
66
- ) ) ]
67
- pub use frame_pointer:: Trace as TraceImpl ;
Original file line number Diff line number Diff line change 1
- impl super :: Frame for backtrace:: Frame {
1
+ impl crate :: backtrace :: Frame for backtrace:: Frame {
2
2
type S = backtrace:: Symbol ;
3
3
4
4
fn ip ( & self ) -> usize {
@@ -16,7 +16,7 @@ impl super::Frame for backtrace::Frame {
16
16
17
17
pub struct Trace { }
18
18
19
- impl super :: Trace for Trace {
19
+ impl crate :: backtrace :: Trace for Trace {
20
20
type Frame = backtrace:: Frame ;
21
21
22
22
fn trace < F : FnMut ( & Self :: Frame ) -> bool > ( _: * mut libc:: c_void , cb : F ) {
Original file line number Diff line number Diff line change @@ -3,13 +3,43 @@ mod nix_impl {
3
3
pub mod addr_validate;
4
4
pub mod profiler;
5
5
pub mod timer;
6
+
7
+ #[ cfg( all(
8
+ any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
9
+ feature = "frame-pointer" ,
10
+ ) ) ]
11
+ mod frame_pointer;
12
+ #[ cfg( all(
13
+ any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
14
+ feature = "frame-pointer" ,
15
+ ) ) ]
16
+ pub use frame_pointer:: Trace as TraceImpl ;
17
+
18
+ #[ cfg( not( all(
19
+ any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
20
+ feature = "frame-pointer" ,
21
+ ) ) ) ]
22
+ #[ path = "../backtrace_rs.rs" ]
23
+ mod backtrace_rs;
24
+ #[ cfg( not( all(
25
+ any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
26
+ feature = "frame-pointer" ,
27
+ ) ) ) ]
28
+ pub use backtrace_rs:: Trace as TraceImpl ;
6
29
}
7
30
8
31
#[ cfg( target_os = "windows" ) ]
9
32
mod windows_impl {
10
33
pub mod addr_validate;
11
34
pub mod profiler;
12
35
pub mod timer;
36
+
37
+ #[ cfg( feature = "frame-pointer" ) ]
38
+ std:: compile_error!( "frame-pointer feature is currently not supported on windows." ) ;
39
+
40
+ #[ path = "../backtrace_rs.rs" ]
41
+ mod backtrace_rs;
42
+ pub use backtrace_rs:: Trace as TraceImpl ;
13
43
}
14
44
15
45
#[ cfg( any( target_os = "linux" , target_os = "macos" ) ) ]
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use std::ptr::null_mut;
4
4
5
5
use libc:: c_void;
6
6
7
- use crate :: addr_validate :: validate;
7
+ use crate :: validate;
8
8
9
9
#[ derive( Clone , Debug ) ]
10
10
pub struct Frame {
@@ -16,7 +16,7 @@ extern "C" {
16
16
17
17
}
18
18
19
- impl super :: Frame for Frame {
19
+ impl crate :: backtrace :: Frame for Frame {
20
20
type S = backtrace:: Symbol ;
21
21
22
22
fn ip ( & self ) -> usize {
@@ -37,7 +37,7 @@ impl super::Frame for Frame {
37
37
}
38
38
39
39
pub struct Trace { }
40
- impl super :: Trace for Trace {
40
+ impl crate :: backtrace :: Trace for Trace {
41
41
type Frame = Frame ;
42
42
43
43
fn trace < F : FnMut ( & Self :: Frame ) -> bool > ( ucontext : * mut libc:: c_void , mut cb : F ) {
You can’t perform that action at this time.
0 commit comments