Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debug support for wasmtime 16 #752

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/livesplit-auto-splitting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ wasi-common = "16.0.0"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.52.0", features = ["Win32_Storage_FileSystem"] }

[features]
default = ["enhanced-backtrace"]
debugger-support = ["wasmtime/debug-builtins"]
enhanced-backtrace = ["wasmtime/addr2line", "wasmtime/demangle"]
11 changes: 6 additions & 5 deletions crates/livesplit-auto-splitting/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,25 @@ fn single_process() -> ProcessRefreshKind {
#[non_exhaustive]
pub struct Config {
/// This enables debug information for the WebAssembly module. This is
/// useful for debugging purposes. This is disabled by default.
/// useful for debugging purposes. By default this `true` if the feature
/// `debugger-support` is enabled.
pub debug_info: bool,
/// This enables optimizations for the WebAssembly module. This is enabled
/// by default. You may want to disable this when debugging the auto
/// splitter.
pub optimize: bool,
/// This enables backtrace details for the WebAssembly module. If a trap
/// occurs more details are printed in the backtrace. This is enabled by
/// default.
/// occurs more details are printed in the backtrace. By default this `true`
/// if the feature `enhanced-backtrace` is enabled.
pub backtrace_details: bool,
}

impl Default for Config {
fn default() -> Self {
Self {
debug_info: false,
debug_info: cfg!(feature = "debugger-support"),
optimize: true,
backtrace_details: true,
backtrace_details: cfg!(feature = "enhanced-backtrace"),
}
}
}
Expand Down
Loading