@@ -168,11 +168,17 @@ impl fmt::Debug for Backtrace {
168
168
} ;
169
169
capture. resolve ( ) ;
170
170
171
+ let frames = if fmt. alternate ( ) {
172
+ & capture. frames [ ..]
173
+ } else {
174
+ & capture. frames [ capture. actual_start ..]
175
+ } ;
176
+
171
177
write ! ( fmt, "Backtrace " ) ?;
172
178
173
179
let mut dbg = fmt. debug_list ( ) ;
174
180
175
- for frame in & capture . frames {
181
+ for frame in frames {
176
182
if frame. frame . ip ( ) . is_null ( ) {
177
183
continue ;
178
184
}
@@ -215,7 +221,7 @@ impl fmt::Debug for BytesOrWide {
215
221
BytesOrWide :: Bytes ( w) => BytesOrWideString :: Bytes ( w) ,
216
222
BytesOrWide :: Wide ( w) => BytesOrWideString :: Wide ( w) ,
217
223
} ,
218
- backtrace:: PrintFmt :: Full ,
224
+ if fmt . alternate ( ) { backtrace:: PrintFmt :: Full } else { backtrace :: PrintFmt :: Short } ,
219
225
crate :: env:: current_dir ( ) . as_ref ( ) . ok ( ) ,
220
226
)
221
227
}
@@ -419,6 +425,7 @@ mod tests {
419
425
let bt = Backtrace :: force_capture ( ) ;
420
426
eprintln ! ( "captured: {:?}" , bt) ;
421
427
eprintln ! ( "display print: {}" , bt) ;
428
+ eprintln ! ( "display print alt: {:#}" , bt) ;
422
429
eprintln ! ( "resolved: {:?}" , bt) ;
423
430
eprintln ! ( "resolved alt: {:#?}" , bt) ;
424
431
unimplemented ! ( ) ;
0 commit comments