Struct wasm_encoder::CoreDumpSection
source · pub struct CoreDumpSection { /* private fields */ }
Expand description
The “core” custom section for coredumps, as described in the tool-conventions repository.
There are four sections that comprise a core dump: - “core”, which contains the name of the core dump - “coremodules”, a listing of modules - “coreinstances”, a listing of module instances - “corestack”, a listing of frames for a specific thread
Example of how these could be constructed and encoded into a module:
use wasm_encoder::{
CoreDumpInstancesSection, CoreDumpModulesSection, CoreDumpSection, CoreDumpStackSection,
CoreDumpValue, Module,
};
let core = CoreDumpSection::new("MyModule.wasm");
let mut modules = CoreDumpModulesSection::new();
modules.module("my_module");
let mut instances = CoreDumpInstancesSection::new();
let module_idx = 0;
let memories = vec![1];
let globals = vec![2];
instances.instance(module_idx, memories, globals);
let mut thread = CoreDumpStackSection::new("main");
let instance_index = 0;
let func_index = 42;
let code_offset = 0x1234;
let locals = vec![CoreDumpValue::I32(1)];
let stack = vec![CoreDumpValue::I32(2)];
thread.frame(instance_index, func_index, code_offset, locals, stack);
let mut module = Module::new();
module.section(&core);
module.section(&modules);
module.section(&instances);
module.section(&thread);
Implementations§
Trait Implementations§
source§impl Clone for CoreDumpSection
impl Clone for CoreDumpSection
source§fn clone(&self) -> CoreDumpSection
fn clone(&self) -> CoreDumpSection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CoreDumpSection
impl Debug for CoreDumpSection
source§impl Default for CoreDumpSection
impl Default for CoreDumpSection
source§fn default() -> CoreDumpSection
fn default() -> CoreDumpSection
Returns the “default value” for a type. Read more
source§impl Encode for CoreDumpSection
impl Encode for CoreDumpSection
Auto Trait Implementations§
impl RefUnwindSafe for CoreDumpSection
impl Send for CoreDumpSection
impl Sync for CoreDumpSection
impl Unpin for CoreDumpSection
impl UnwindSafe for CoreDumpSection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more