mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-09 13:37:55 +00:00
Various fixes
This commit is contained in:
@@ -26,7 +26,7 @@ all = [
|
||||
"arm64",
|
||||
"mips",
|
||||
"ppc",
|
||||
"x86",
|
||||
# "x86",
|
||||
]
|
||||
# Implicit, used to check if any arch is enabled
|
||||
any-arch = [
|
||||
@@ -193,20 +193,7 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = { version = "1.0" }
|
||||
syn = { version = "2.0", optional = true }
|
||||
|
||||
# Enable all features for tests
|
||||
[dev-dependencies]
|
||||
objdiff-core = { path = ".", features = [
|
||||
# Features
|
||||
"bindings",
|
||||
"build",
|
||||
"config",
|
||||
"dwarf",
|
||||
"serde",
|
||||
# Architectures
|
||||
"mips",
|
||||
"ppc",
|
||||
# "x86",
|
||||
"arm",
|
||||
"arm64",
|
||||
] }
|
||||
# Enable all features for tests
|
||||
objdiff-core = { path = ".", features = ["all"] }
|
||||
insta = "1.42.1"
|
||||
|
||||
@@ -285,9 +285,7 @@ fn push_args(
|
||||
} else {
|
||||
arg_cb(InstructionPart::Arg(InstructionArg::Value(
|
||||
InstructionArgValue::Opaque(
|
||||
op.display(instruction, display_flags, None::<&str>)
|
||||
.to_string()
|
||||
.into(),
|
||||
op.display(instruction, display_flags, None::<&str>).to_string().into(),
|
||||
),
|
||||
)))?;
|
||||
}
|
||||
|
||||
@@ -107,11 +107,7 @@ fn diff_data_relocs_for_range<'left, 'right>(
|
||||
if reloc_eq(left_obj, right_obj, &left_reloc, &right_reloc) {
|
||||
diffs.push((DataDiffKind::None, Some(left_reloc), Some(right_reloc)));
|
||||
} else {
|
||||
diffs.push((
|
||||
DataDiffKind::Replace,
|
||||
Some(left_reloc),
|
||||
Some(right_reloc),
|
||||
));
|
||||
diffs.push((DataDiffKind::Replace, Some(left_reloc), Some(right_reloc)));
|
||||
}
|
||||
}
|
||||
for right_reloc in right_section.relocations.iter() {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
use objdiff_core::{diff, obj};
|
||||
|
||||
mod common;
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "x86")]
|
||||
fn read_x86() {
|
||||
let diff_config = diff::DiffObjConfig::default();
|
||||
let obj = obj::read::parse(include_object!("data/x86/rtest.obj"), &diff_config).unwrap();
|
||||
insta::assert_debug_snapshot!(obj);
|
||||
let symbol_idx =
|
||||
obj.symbols.iter().position(|s| s.name == "Type2Text__10SObjectTagFUi").unwrap();
|
||||
let diff = diff::code::no_diff_code(&obj, symbol_idx, &diff_config).unwrap();
|
||||
insta::assert_debug_snapshot!(diff.instruction_rows);
|
||||
let output = common::display_diff(&obj, &diff, symbol_idx, &diff_config);
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
Reference in New Issue
Block a user