#[repr(C)]pub struct FunctionDebugMeta {
pub func_name: *const u8,
pub func_name_len: u32,
pub local_count: u32,
pub locals: *const DebugLocalMeta,
pub span_start: u32,
pub span_end: u32,
}Expand description
Everything the crash debugger needs about a function that does not vary
per call: its name, its source extent, and the metadata for its Gc locals.
One of these exists per lowered function, interned by content in the JIT
generation arena (ADR-043), so a debugger session that recompiles the same
function on every p EXPR (DBG-05) pays for it once. A generated prologue
stores its address into a DebugFrameEntry — one immediate, one store.
#[repr(C)] because generated code writes its address and
crate::crash_snapshot reads its fields across the ABI boundary.
Fields§
§func_name: *const u8The function’s source name (a 'static embedded string).
func_name_len: u32The function name’s byte length.
local_count: u32How many Gc locals this function has — the length of both locals and
the run of value slots a call of it claims.
locals: *const DebugLocalMetalocal_count entries, in debug-slot order: the local’s position among
this function’s Gc locals, in MIR local order. Entry i describes the
word at displacement i of the run a call claims, which is what
crate::crash_snapshot and DebugFrameStackHeader::clear_reclaimed
rely on when they zip the two.
Debug-slot order is not shadow-slot order (ADR-128 decision 3): a
shadow slot index is a colour — is_prime’s shadow indices are {0}
while its debug indices are 0..33 — so the two stacks are not
index-parallel with each other.
span_start: u32The function’s source span [start, end) as byte offsets into the
program source (§9.3 “current source span”, ADR-035 decision 3). (0, 0)
means “no span recorded” — the __fnvalue_* adapter and __p_expr,
whose bodies nobody wrote. A closure’s span is its literal’s.
span_end: u32