wasmtime: Add a Config::native_unwind_info method (#4643)

This method configures whether native unwind information (e.g. `.eh_frame` on
Linux) is generated or not.

This helps integrate with third-party stack capturing tools, such as the system
unwinder or the `backtrace` crate. It does not affect whether Wasmtime can
capture stack traces in Wasm code that it is running or not.

Unwind info is always enabled on Windows, since the Windows ABI requires it.

This configuration option defaults to true.

Additionally, we deprecate `Config::wasm_backtrace` since we can always cheaply
capture stack traces ever since
https://github.com/bytecodealliance/wasmtime/pull/4431.

Fixes https://github.com/bytecodealliance/wasmtime/issues/4554
This commit is contained in:
Nick Fitzgerald
2022-08-08 13:54:51 -07:00
committed by GitHub
parent e463890f26
commit ec47335b9c
4 changed files with 45 additions and 34 deletions

View File

@@ -71,6 +71,7 @@ fn test_trap_trace() -> Result<()> {
}
#[test]
#[allow(deprecated)]
fn test_trap_backtrace_disabled() -> Result<()> {
let mut config = Config::default();
config.wasm_backtrace(false);