PPC: Guess reloc data type based on the instruction. (#108)

* Guess reloc data type based on the instruction.

Adds an entry to the reloc tooltip to show the inferred data type
and value.

* Fix clippy warning

* Match on Opcode rather than mnemonic string
This commit is contained in:
Steven Casper
2024-09-26 01:45:37 -04:00
committed by GitHub
parent 35bbd40f5d
commit a43320af1f
5 changed files with 154 additions and 3 deletions

View File

@@ -79,6 +79,12 @@ fn ins_hover_ui(
appearance.highlight_color,
format!("Size: {:x}", reloc.target.size),
);
if let Some(s) = arch
.guess_data_type(ins)
.and_then(|ty| arch.display_data_type(ty, &reloc.target.bytes))
{
ui.colored_label(appearance.highlight_color, s);
}
} else {
ui.colored_label(appearance.highlight_color, "Extern".to_string());
}