diff --git a/lib/wasmex/engine_config.ex b/lib/wasmex/engine_config.ex index 1ecbc2d..ae66091 100644 --- a/lib/wasmex/engine_config.ex +++ b/lib/wasmex/engine_config.ex @@ -7,6 +7,9 @@ defmodule Wasmex.EngineConfig do * `:consume_fuel` - Whether or not to consume fuel when executing Wasm instructions. This defaults to `false`. * `:cranelift_opt_level` - Optimization level for the Cranelift code generator. This defaults to `:none`. * `:wasm_backtrace_details` - Whether or not backtraces in traps will parse debug info in the Wasm file to have filename/line number information. This defaults to `false`. + * `:debug_info` - Configures whether DWARF debug information will be emitted during compilation. This defaults to `false`. + * `:memory64` - Whether or not to use 64-bit memory. This defaults to `false`. + * `:wasm_component_model` - Whether or not to use the WebAssembly component model. This defaults to `true`. ## Example @@ -20,13 +23,16 @@ defmodule Wasmex.EngineConfig do cranelift_opt_level: :none, wasm_backtrace_details: false, memory64: false, - wasm_component_model: true + wasm_component_model: true, + debug_info: false @type t :: %__MODULE__{ consume_fuel: boolean(), cranelift_opt_level: :none | :speed | :speed_and_size, wasm_backtrace_details: boolean(), - memory64: boolean() + memory64: boolean(), + wasm_component_model: boolean(), + debug_info: boolean() } @doc ~S""" diff --git a/native/wasmex/src/engine.rs b/native/wasmex/src/engine.rs index abdfa5f..3802a9b 100644 --- a/native/wasmex/src/engine.rs +++ b/native/wasmex/src/engine.rs @@ -13,6 +13,7 @@ pub struct ExEngineConfig { cranelift_opt_level: rustler::Atom, memory64: bool, wasm_component_model: bool, + debug_info: bool, } #[rustler::resource_impl()] @@ -70,6 +71,7 @@ pub(crate) fn engine_config(engine_config: ExEngineConfig) -> Config { config.cranelift_opt_level(cranelift_opt_level); config.wasm_memory64(engine_config.memory64); config.wasm_component_model(engine_config.wasm_component_model); + config.debug_info(engine_config.debug_info); config }