Use capstone to validate precise-output tests (#5780)

Use the capstone library to disassemble precise-output tests, in addition to pretty-printing their vcode.
This commit is contained in:
Trevor Elliott
2023-02-15 16:35:10 -08:00
committed by GitHub
parent eabd43a178
commit f04decc4a1
277 changed files with 39340 additions and 98 deletions

View File

@@ -87,7 +87,7 @@ impl TargetIsa for S390xBackend {
Ok(CompiledCodeStencil {
buffer,
frame_size,
disasm: emit_result.disasm,
vcode: emit_result.disasm,
value_labels_ranges,
sized_stackslot_offsets,
dynamic_stackslot_offsets,
@@ -170,6 +170,19 @@ impl TargetIsa for S390xBackend {
fn function_alignment(&self) -> u32 {
4
}
#[cfg(feature = "disas")]
fn to_capstone(&self) -> Result<capstone::Capstone, capstone::Error> {
use capstone::prelude::*;
let mut cs = Capstone::new()
.sysz()
.mode(arch::sysz::ArchMode::Default)
.build()?;
cs.set_skipdata(true)?;
Ok(cs)
}
}
impl fmt::Display for S390xBackend {