@@ -534,12 +534,6 @@ mod tests {
534
534
535
535
#[ test]
536
536
fn test_frame_conversion ( ) {
537
- // captures an original backtrace, and makes sure that the manual conversion
538
- // to frames yields the same results.
539
- let mut bt = Backtrace :: new ( ) ;
540
- bt. resolve ( ) ;
541
- let original_frames = bt. frames ( ) ;
542
-
543
537
let mut frames = vec ! [ ] ;
544
538
crate :: trace ( |frame| {
545
539
let converted = BacktraceFrame :: from ( frame. clone ( ) ) ;
@@ -551,35 +545,11 @@ mod tests {
551
545
manual. resolve ( ) ;
552
546
let frames = manual. frames ( ) ;
553
547
554
- // the first frames can be different because we call from slightly different places,
555
- // and the `trace` version has an extra capture. But because of inlining the number of
556
- // frames that differ may be different between release and debug versions. Plus who knows
557
- // what the compiler will do in the future. So we just take 4 frames from the end and make
558
- // sure they match
559
- //
560
- // For miri, every backtrace that is taken yields different addresses and different
561
- // instruction pointers. That is irrespective of conversion and happens even if
562
- // Backtrace::new() is invoked in a row. They all resolve to the same names, though, so to
563
- // make sure this works on miri we resolve the symbols and compare the results. It is okay
564
- // if some addresses don't have symbols, but if we scan enough frames at least some will do
565
- for ( converted, og) in frames
566
- . iter ( )
567
- . rev ( )
568
- . take ( 4 )
569
- . zip ( original_frames. iter ( ) . rev ( ) . take ( 4 ) )
570
- {
571
- let converted_symbols = converted. symbols ( ) ;
572
- let og_symbols = og. symbols ( ) ;
573
-
574
- assert_eq ! ( og_symbols. len( ) , converted_symbols. len( ) ) ;
575
- for ( os, cs) in og_symbols. iter ( ) . zip ( converted_symbols. iter ( ) ) {
576
- assert_eq ! (
577
- os. name( ) . map( |x| x. as_bytes( ) ) ,
578
- cs. name( ) . map( |x| x. as_bytes( ) )
579
- ) ;
580
- assert_eq ! ( os. filename( ) , cs. filename( ) ) ;
581
- assert_eq ! ( os. lineno( ) , cs. lineno( ) ) ;
582
- }
548
+ for frame in frames {
549
+ println ! ( "{:?}" , frame. ip( ) ) ;
550
+ println ! ( "{:?}" , frame. symbol_address( ) ) ;
551
+ println ! ( "{:?}" , frame. module_base_address( ) ) ;
552
+ println ! ( "{:?}" , frame. symbols( ) ) ;
583
553
}
584
554
}
585
555
}
0 commit comments