Instruction hover / context menu improvements

This commit is contained in:
2024-05-20 17:38:20 -06:00
parent 8b36fa4fc6
commit 5bfaaaaf65
10 changed files with 68 additions and 25 deletions

View File

@@ -57,6 +57,7 @@ impl ObjArch for ObjArchX86 {
reloc: None,
branch_dest: None,
line: None,
formatted: String::new(),
orig: None,
},
error: None,
@@ -81,6 +82,7 @@ impl ObjArch for ObjArchX86 {
reloc: reloc.cloned(),
branch_dest: None,
line: obj.line_info.as_ref().and_then(|m| m.get(&address).cloned()),
formatted: String::new(),
orig: None,
};
// Run the formatter, which will populate output.ins
@@ -89,7 +91,7 @@ impl ObjArch for ObjArchX86 {
return Err(error);
}
ensure!(output.ins_operands.len() == output.ins.args.len());
output.ins.orig = Some(output.formatted.clone());
output.ins.formatted.clone_from(&output.formatted);
// Make sure we've put the relocation somewhere in the instruction
if reloc.is_some() && !output.ins.args.iter().any(|a| matches!(a, ObjInsArg::Reloc)) {