MCPcopy Index your code
hub / github.com/RustPython/RustPython / dump_live_frames

Function dump_live_frames

crates/stdlib/src/faulthandler.rs:231–249  ·  view source on GitHub ↗
(fd: i32)

Source from the content-addressed store, hash-verified

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))]

Callers 2

watchdog_threadFunction · 0.85

Calls 4

get_current_frameFunction · 0.85
putsFunction · 0.85
dump_frame_from_rawFunction · 0.85
previous_frameMethod · 0.80

Tested by

no test coverage detected