Skip to main content

FunctionDebugMeta

Struct FunctionDebugMeta 

Source
#[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 u8

The function’s source name (a 'static embedded string).

§func_name_len: u32

The function name’s byte length.

§local_count: u32

How many Gc locals this function has — the length of both locals and the run of value slots a call of it claims.

§locals: *const DebugLocalMeta

local_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 colouris_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: u32

The 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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.