Sha256: 91c7e564b1bcad3ac636c8d89d59ed08b39caaf6d63dafd969e6fd87c0545c36

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

use super::CallThreadState;
use crate::prelude::*;
use crate::runtime::vm::{Backtrace, VMRuntimeLimits};
use wasm_encoder::CoreDumpValue;

/// A WebAssembly Coredump
#[derive(Debug)]
pub struct CoreDumpStack {
    /// The backtrace containing the stack frames for the CoreDump
    pub bt: Backtrace,

    /// The locals for each frame in the backtrace.
    ///
    /// This is not currently implemented.
    #[allow(dead_code)]
    pub locals: Vec<Vec<CoreDumpValue>>,

    /// The operands for each stack frame
    ///
    /// This is not currently implemented.
    #[allow(dead_code)]
    pub operand_stack: Vec<Vec<CoreDumpValue>>,
}

impl CallThreadState {
    pub(super) fn capture_coredump(
        &self,
        limits: *const VMRuntimeLimits,
        trap_pc_and_fp: Option<(usize, usize)>,
    ) -> Option<CoreDumpStack> {
        if !self.capture_coredump {
            return None;
        }
        let bt =
            unsafe { Backtrace::new_with_trap_state(limits, self.unwinder, self, trap_pc_and_fp) };

        Some(CoreDumpStack {
            bt,
            locals: vec![],
            operand_stack: vec![],
        })
    }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wasmtime-30.0.2 ./ext/cargo-vendor/wasmtime-30.0.2/src/runtime/vm/traphandlers/coredump_enabled.rs
wasmtime-29.0.0 ./ext/cargo-vendor/wasmtime-29.0.0/src/runtime/vm/traphandlers/coredump_enabled.rs