(fd: i32, all_threads: bool)
| 277 | // faulthandler_dump_traceback (signal-safe, for fatal errors) |
| 278 | #[cfg(any(unix, windows))] |
| 279 | fn faulthandler_dump_traceback(fd: i32, all_threads: bool) { |
| 280 | static REENTRANT: AtomicBool = AtomicBool::new(false); |
| 281 | |
| 282 | if REENTRANT.swap(true, Ordering::SeqCst) { |
| 283 | return; |
| 284 | } |
| 285 | |
| 286 | // Write thread header |
| 287 | if all_threads { |
| 288 | write_thread_id(fd, current_thread_id(), true); |
| 289 | } else { |
| 290 | puts(fd, "Stack (most recent call first):\n"); |
| 291 | } |
| 292 | |
| 293 | dump_live_frames(fd); |
| 294 | |
| 295 | REENTRANT.store(false, Ordering::SeqCst); |
| 296 | } |
| 297 | |
| 298 | /// MAX_STRING_LENGTH in traceback.c |
| 299 | const MAX_STRING_LENGTH: usize = 500; |
no test coverage detected