mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-09 13:37:55 +00:00
Version 0.2.0
- Update checker & auto-updater - Configure font sizes and diff colors - Data diffing bug fixes & improvements - Bug fix for low match percent - Improvements to Jobs UI (cancel, dismiss errors) - "Demangle" tool Closes #6, #13, #17, #19
This commit is contained in:
@@ -63,7 +63,7 @@ fn to_obj_symbol(obj_file: &File<'_>, symbol: &Symbol<'_, '_>, addend: i64) -> R
|
||||
addend,
|
||||
diff_symbol: None,
|
||||
instructions: vec![],
|
||||
match_percent: 0.0,
|
||||
match_percent: None,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ fn filter_sections(obj_file: &File<'_>) -> Result<Vec<ObjSection>> {
|
||||
continue;
|
||||
}
|
||||
let name = section.name().context("Failed to process section name")?;
|
||||
let data = section.data().context("Failed to read section data")?;
|
||||
let data = section.uncompressed_data().context("Failed to read section data")?;
|
||||
result.push(ObjSection {
|
||||
name: name.to_string(),
|
||||
kind: to_obj_section_kind(section.kind()),
|
||||
@@ -183,7 +183,7 @@ fn find_section_symbol(
|
||||
addend: offset_addr as i64,
|
||||
diff_symbol: None,
|
||||
instructions: vec![],
|
||||
match_percent: 0.0,
|
||||
match_percent: None,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -290,8 +290,11 @@ fn relocations_by_section(
|
||||
}
|
||||
|
||||
pub fn read(obj_path: &Path) -> Result<ObjInfo> {
|
||||
let bin_data = fs::read(obj_path)?;
|
||||
let obj_file = File::parse(&*bin_data)?;
|
||||
let data = {
|
||||
let file = fs::File::open(obj_path)?;
|
||||
unsafe { memmap2::Mmap::map(&file) }?
|
||||
};
|
||||
let obj_file = File::parse(&*data)?;
|
||||
let architecture = match obj_file.architecture() {
|
||||
Architecture::PowerPc => ObjArchitecture::PowerPc,
|
||||
Architecture::Mips => ObjArchitecture::Mips,
|
||||
|
||||
@@ -109,6 +109,7 @@ pub struct ObjDataDiff {
|
||||
pub data: Vec<u8>,
|
||||
pub kind: ObjDataDiffKind,
|
||||
pub len: usize,
|
||||
pub symbol: String,
|
||||
}
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ObjSymbol {
|
||||
@@ -124,7 +125,7 @@ pub struct ObjSymbol {
|
||||
// Diff
|
||||
pub diff_symbol: Option<String>,
|
||||
pub instructions: Vec<ObjInsDiff>,
|
||||
pub match_percent: f32,
|
||||
pub match_percent: Option<f32>,
|
||||
}
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum ObjArchitecture {
|
||||
|
||||
Reference in New Issue
Block a user