Skip to content

Commit

Permalink
Fix PPC branch display; update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
encounter committed Mar 23, 2024
1 parent 30d1487 commit 106652a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ A local diffing tool for decompilation projects. Inspired by [decomp.me](https:/

Features:
- Compare entire object files: functions and data.
- Built-in symbol demangling for C++.
- Built-in symbol demangling for C++. (CodeWarrior, Itanium & MSVC)
- Automatic rebuild on source file changes.
- Project integration via [configuration file](#configuration).
- Search and filter all of a project's objects and quickly switch.
- Click to highlight all instances of values and registers.

Supports:
- PowerPC 750CL (GameCube & Wii)
- MIPS (Nintendo 64)
- MIPS (Nintendo 64 & PS2)
- x86 (PE only at the moment)

See [Usage](#usage) for more information.

Expand Down
4 changes: 1 addition & 3 deletions objdiff-cli/src/cmd/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ pub fn run(args: Args) -> Result<()> {
return Some(obj);
}

let Some(up) = unit_path.as_deref() else {
return None;
};
let up = unit_path.as_deref()?;

resolve_paths(obj);

Expand Down
6 changes: 5 additions & 1 deletion objdiff-core/src/diff/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ pub fn display_diff<E>(
display_reloc_name(ins.reloc.as_ref().unwrap(), &mut cb)?;
}
ObjInsArg::BranchDest(dest) => {
cb(DiffText::BranchDest(*dest))?;
if let Some(dest) = dest.checked_sub(base_addr) {
cb(DiffText::BranchDest(dest))?;
} else {
cb(DiffText::Basic("<unknown>"))?;
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions objdiff-core/src/diff/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ pub enum X86Formatter {
Masm,
}

#[inline]
const fn default_true() -> bool { true }

#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct DiffObjConfig {
pub relax_reloc_diffs: bool,
#[serde(default = "default_true")]
pub space_between_args: bool,
pub x86_formatter: X86Formatter,
}
Expand Down

0 comments on commit 106652a

Please sign in to comment.