MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_dwarfdump

Function get_dwarfdump

tests/all/native_debug/dump.rs:10–27  ·  view source on GitHub ↗
(obj: &str, section: DwarfDumpSection)

Source from the content-addressed store, hash-verified

8}
9
10pub fn get_dwarfdump(obj: &str, section: DwarfDumpSection) -> Result<String> {
11 let dwarfdump = env::var("DWARFDUMP").unwrap_or("llvm-dwarfdump".to_string());
12 let section_flag = match section {
13 DwarfDumpSection::DebugInfo => "-debug-info",
14 };
15 let output = Command::new(&dwarfdump)
16 .args(&[section_flag, obj])
17 .output()
18 .with_context(|| format!("failed to spawn `{dwarfdump}`"))?;
19 if !output.status.success() {
20 bail!(
21 "failed to execute {}: {}",
22 dwarfdump,
23 String::from_utf8_lossy(&output.stderr),
24 );
25 }
26 Ok(String::from_utf8_lossy(&output.stdout).to_string())
27}

Callers 2

check_wasmFunction · 0.85
check_watFunction · 0.85

Calls 7

OkFunction · 0.85
with_contextMethod · 0.80
outputMethod · 0.80
newFunction · 0.50
to_stringMethod · 0.45
argsMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected