You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-2Lines changed: 75 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,87 @@
5
5
6
6
A local diffing tool for decompilation projects.
7
7
8
-
Currently supports:
8
+
Supports:
9
9
- PowerPC 750CL (GameCube & Wii)
10
10
- MIPS (Nintendo 64)
11
11
12
+
See [Usage](#usage) for more information.
13
+
12
14

13
15

14
16
15
-
### License
17
+
## Usage
18
+
19
+
objdiff works by comparing two relocatable object files (`.o`). The objects are expected to have the same relative path from the "target" and "base" directories.
20
+
21
+
For example, if the target ("expected") object is located at `build/asm/MetroTRK/mslsupp.o` and the base ("actual") object
22
+
is located at `build/src/MetroTRK/mslsupp.o`, the following configuration would be used:
23
+
24
+
- Target build directory: `build/asm`
25
+
- Base build directory: `build/src`
26
+
- Object: `MetroTRK/mslsupp.o`
27
+
28
+
objdiff will then execute the build system from the project directory to build both objects:
29
+
30
+
```sh
31
+
$ make build/asm/MetroTRK/mslsupp.o # Only if "Build target object" is enabled
32
+
$ make build/src/MetroTRK/mslsupp.o
33
+
```
34
+
35
+
The objects will then be compared and the results will be displayed in the UI.
36
+
37
+
See [Configuration](#configuration) for more information.
38
+
39
+
## Configuration
40
+
41
+
While **not required** (most settings can be specified in the UI), projects can add an `objdiff.json` (or `objdiff.yaml`, `objdiff.yml`) file to configure the tool automatically. The configuration file must be located in the root project directory.
42
+
43
+
```json5
44
+
// objdiff.json
45
+
{
46
+
"custom_make":"ninja",
47
+
"target_dir":"build/mp1.0/asm",
48
+
"base_dir":"build/mp1.0/src",
49
+
"build_target":true,
50
+
"watch_patterns": [
51
+
"*.c",
52
+
"*.cp",
53
+
"*.cpp",
54
+
"*.h",
55
+
"*.hpp",
56
+
"*.py"
57
+
],
58
+
"objects": [
59
+
{
60
+
"path":"MetroTRK/mslsupp.o",
61
+
"name":"MetroTRK/mslsupp",
62
+
"reverse_fn_order":false
63
+
},
64
+
// ...
65
+
]
66
+
}
67
+
```
68
+
69
+
-`custom_make`_(optional)_: By default, objdiff will use `make` to build the project.
70
+
If the project uses a different build system (e.g. `ninja`), specify it here.
71
+
-`target_dir`: Relative from the root of the project, this where the "target" or "expected" objects are located.
72
+
These are the **intended result** of the match.
73
+
-`base_dir`: Relative from the root of the project, this is where the "base" or "actual" objects are located.
74
+
These are objects built from the **current source code**.
75
+
-`build_target`: If true, objdiff will tell the build system to build the target objects before diffing (e.g. `make path/to/target.o`).
76
+
This is useful if the target objects are not built by default or can change based on project configuration or edits to assembly files.
77
+
Requires the build system to be configured properly.
78
+
-`watch_patterns`_(optional)_: A list of glob patterns to watch for changes. ([Supported syntax](https://docs.rs/globset/latest/globset/#syntax))
79
+
If any of these files change, objdiff will automatically rebuild the objects and re-compare them.
80
+
-`objects`_(optional)_: If specified, objdiff will display a list of objects in the sidebar for easy navigation.
81
+
-`path`: Relative path to the object from the `target_dir` and `base_dir`.
82
+
-`name`_(optional)_: The name of the object in the UI. If not specified, the object's `path` will be used.
83
+
-`reverse_fn_order`_(optional)_: Displays function symbols in reversed order.
84
+
Used to support MWCC's `-inline deferred` option, which reverses the order of functions in the object file.
0 commit comments