Skip to main content

DebugSourceNode

Type Alias DebugSourceNode 

Source
pub type DebugSourceNode = SourceNode<MastNodeId, DebugSourceNodeId>;
Expand description

A source/debug occurrence for code that produced an executable MAST node.

The exec_node field points into the package MastForest after executable MAST reduction and deduplication. More than one DebugSourceNode may point at the same exec_node: for example, two source procedures can compile to the same MAST root while still carrying different source spans, assembly-op rows, or debug-variable rows. Consumers should treat the DebugSourceNodeId as the identity of the source occurrence and use exec_node only to find the executable node it describes.

Assembly-operation, variable, and inline-call rows are stored directly on each source occurrence.

Aliased Type§

pub struct DebugSourceNode {
    pub exec_node: MastNodeId,
    pub children: Vec<DebugSourceNodeId>,
    pub op_start: u32,
    pub op_end: u32,
    pub asm_ops: Vec<DebugSourceAsmOp>,
    pub debug_vars: Vec<DebugSourceVar>,
    pub inline_calls: Vec<DebugSourceInlineCall>,
}

Fields§

§exec_node: MastNodeId

The executable MAST node represented by this source occurrence.

§children: Vec<DebugSourceNodeId>

Child source occurrences, in the same order as the executable node’s children.

§op_start: u32

Inclusive start operation index in the executable node.

§op_end: u32

Exclusive end operation index in the executable node.

§asm_ops: Vec<DebugSourceAsmOp>

Operation metadata for operations attached to this node

§debug_vars: Vec<DebugSourceVar>

Debug variable metadata for operations attached to this node

§inline_calls: Vec<DebugSourceInlineCall>

Inline-call metadata for operations attached to this node.

A zero-width external occurrence may carry rows at its start index. Those rows describe the inline chain inherited by the resolved target rather than an operation on the external node.

Trait Implementations§

Source§

impl Deserializable for DebugSourceNode

Available on little-endian only.
Source§

fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>

Reads a sequence of bytes from the provided source, attempts to deserialize these bytes into Self, and returns the result. Read more
Source§

fn min_serialized_size() -> usize

Returns the minimum serialized size for one instance of this type. Read more
Source§

fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>

Attempts to deserialize the provided bytes into Self and returns the result. Read more
Source§

fn read_from_bytes_with_budget( bytes: &[u8], budget: usize, ) -> Result<Self, DeserializationError>

Deserializes Self from bytes with a byte budget limit. Read more
Source§

impl Serializable for DebugSourceNode

Available on little-endian only.

Fixed-size child and assembly-op tables use the same certified row format as PackageDebugInfo.

Source§

fn write_into<W: ByteWriter>(&self, target: &mut W)

Serializes self into bytes and writes these bytes into the target.
Source§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.
Source§

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self. Read more