(fd: i32)
| 229 | /// thread-local current frame pointer. |
| 230 | #[cfg(any(unix, windows))] |
| 231 | fn dump_live_frames(fd: i32) { |
| 232 | const MAX_FRAME_DEPTH: usize = 100; |
| 233 | |
| 234 | let mut frame_ptr = crate::vm::vm::thread::get_current_frame(); |
| 235 | if frame_ptr.is_null() { |
| 236 | puts(fd, " <no Python frame>\n"); |
| 237 | return; |
| 238 | } |
| 239 | let mut depth = 0; |
| 240 | while !frame_ptr.is_null() && depth < MAX_FRAME_DEPTH { |
| 241 | let frame = unsafe { &*frame_ptr }; |
| 242 | dump_frame_from_raw(fd, frame); |
| 243 | frame_ptr = frame.previous_frame(); |
| 244 | depth += 1; |
| 245 | } |
| 246 | if depth >= MAX_FRAME_DEPTH && !frame_ptr.is_null() { |
| 247 | puts(fd, " ...\n"); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /// Dump a single frame's info to fd (signal-safe), reading live data. |
| 252 | #[cfg(any(unix, windows))] |
no test coverage detected