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

Function dump_frame_from_ref

crates/stdlib/src/faulthandler.rs:328–344  ·  view source on GitHub ↗
(fd: i32, frame: &crate::vm::Py<Frame>)

Source from the content-addressed store, hash-verified

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

Callers 3

dump_tracebackFunction · 0.85
dump_all_threadsFunction · 0.85

Calls 9

putsFunction · 0.85
dump_asciiFunction · 0.85
dump_decimalFunction · 0.85
lastiMethod · 0.80
current_locationMethod · 0.80
as_strMethod · 0.45
source_pathMethod · 0.45
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected