(fd: i32, frame: &crate::vm::Py<Frame>)
| 326 | /// Write a frame's info to an fd using signal-safe I/O. |
| 327 | #[cfg(any(unix, windows))] |
| 328 | fn dump_frame_from_ref(fd: i32, frame: &crate::vm::Py<Frame>) { |
| 329 | let funcname = frame.code.obj_name.as_str(); |
| 330 | let filename = frame.code.source_path().as_str(); |
| 331 | let lineno = if frame.lasti() == 0 { |
| 332 | frame.code.first_line_number.map(|n| n.get()).unwrap_or(1) as u32 |
| 333 | } else { |
| 334 | frame.current_location().line.get() as u32 |
| 335 | }; |
| 336 | |
| 337 | puts(fd, " File \""); |
| 338 | dump_ascii(fd, filename); |
| 339 | puts(fd, "\", line "); |
| 340 | dump_decimal(fd, lineno as usize); |
| 341 | puts(fd, " in "); |
| 342 | dump_ascii(fd, funcname); |
| 343 | puts(fd, "\n"); |
| 344 | } |
| 345 | |
| 346 | /// Dump traceback for a thread given its frame stack (for cross-thread dumping). |
| 347 | /// # Safety |
no test coverage detected