mirror of https://github.com/encounter/objdiff.git
Compare commits
6 Commits
2ab519d361
...
319b1c35c0
Author | SHA1 | Date |
---|---|---|
Luke Street | 319b1c35c0 | |
Luke Street | 634e007cbc | |
Luke Street | 6ee11ca640 | |
Luke Street | 8278d5d207 | |
Luke Street | 09bbc534bd | |
Luke Street | fa28352e08 |
|
@ -86,6 +86,17 @@ version = "1.0.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.8.2"
|
||||
|
@ -107,6 +118,15 @@ dependencies = [
|
|||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "android_system_properties"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.68"
|
||||
|
@ -177,6 +197,15 @@ version = "0.7.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
|
||||
|
||||
[[package]]
|
||||
name = "ash"
|
||||
version = "0.37.2+1.3.238"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28bf19c1f0a470be5fbf7522a308a05df06610252c5bcf5143e1b23f629a9a03"
|
||||
dependencies = [
|
||||
"libloading",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atk-sys"
|
||||
version = "0.15.1"
|
||||
|
@ -213,6 +242,21 @@ version = "0.21.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
||||
|
||||
[[package]]
|
||||
name = "bit-set"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-vec"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
|
@ -401,6 +445,16 @@ dependencies = [
|
|||
"objc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codespan-reporting"
|
||||
version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
|
||||
dependencies = [
|
||||
"termcolor",
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.6"
|
||||
|
@ -573,6 +627,17 @@ dependencies = [
|
|||
"argh",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "d3d12"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"libloading",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.13.4"
|
||||
|
@ -737,6 +802,7 @@ dependencies = [
|
|||
"bytemuck",
|
||||
"directories-next",
|
||||
"egui",
|
||||
"egui-wgpu",
|
||||
"egui-winit",
|
||||
"egui_glow",
|
||||
"glow",
|
||||
|
@ -750,6 +816,7 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
|
@ -760,7 +827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "65a5e883a316e53866977450eecfbcac9c48109c2ab3394af29feb83fcde4ea9"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"ahash",
|
||||
"ahash 0.8.2",
|
||||
"epaint",
|
||||
"nohash-hasher",
|
||||
"ron",
|
||||
|
@ -768,6 +835,21 @@ dependencies = [
|
|||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui-wgpu"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3a6edfac4c02455f5024dc7cda997629b94748571935773d1a0cfab8213c80a"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"egui",
|
||||
"pollster",
|
||||
"tracing",
|
||||
"type-map",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui-winit"
|
||||
version = "0.20.1"
|
||||
|
@ -884,7 +966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "de14b65fe5e423e0058f77a8beb2c863b056d0566d6c4ce0d097aa5814cb705a"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"ahash",
|
||||
"ahash 0.8.2",
|
||||
"atomic_refcell",
|
||||
"bytemuck",
|
||||
"ecolor",
|
||||
|
@ -1118,6 +1200,15 @@ dependencies = [
|
|||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fxhash"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf-sys"
|
||||
version = "0.15.10"
|
||||
|
@ -1309,6 +1400,45 @@ dependencies = [
|
|||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-alloc"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"gpu-alloc-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-alloc-types"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"gpu-descriptor-types",
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor-types"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gtk-sys"
|
||||
version = "0.15.3"
|
||||
|
@ -1351,6 +1481,9 @@ name = "hashbrown"
|
|||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
dependencies = [
|
||||
"ahash 0.7.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
|
@ -1367,6 +1500,12 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hexf-parse"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
|
||||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "0.2.8"
|
||||
|
@ -1571,6 +1710,17 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "khronos-egl"
|
||||
version = "4.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"libloading",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "khronos_api"
|
||||
version = "3.1.0"
|
||||
|
@ -1705,6 +1855,20 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "metal"
|
||||
version = "0.24.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"block",
|
||||
"core-graphics-types",
|
||||
"foreign-types 0.3.2",
|
||||
"log",
|
||||
"objc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mime"
|
||||
version = "0.3.16"
|
||||
|
@ -1738,6 +1902,26 @@ dependencies = [
|
|||
"windows-sys 0.42.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bitflags",
|
||||
"codespan-reporting",
|
||||
"hexf-parse",
|
||||
"indexmap",
|
||||
"log",
|
||||
"num-traits",
|
||||
"rustc-hash",
|
||||
"spirv",
|
||||
"termcolor",
|
||||
"thiserror",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "native-tls"
|
||||
version = "0.2.11"
|
||||
|
@ -1945,6 +2129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
|
||||
dependencies = [
|
||||
"malloc_buf",
|
||||
"objc_exception",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1984,6 +2169,15 @@ dependencies = [
|
|||
"objc-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc_exception"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc_id"
|
||||
version = "0.1.1"
|
||||
|
@ -2191,6 +2385,12 @@ dependencies = [
|
|||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pollster"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"
|
||||
|
||||
[[package]]
|
||||
name = "portable-atomic"
|
||||
version = "0.3.19"
|
||||
|
@ -2256,6 +2456,12 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "profiling"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df"
|
||||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.22.0"
|
||||
|
@ -2315,6 +2521,12 @@ dependencies = [
|
|||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "range-alloc"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6"
|
||||
|
||||
[[package]]
|
||||
name = "raw-window-handle"
|
||||
version = "0.4.3"
|
||||
|
@ -2379,6 +2591,12 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "renderdoc-sys"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157"
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.11.14"
|
||||
|
@ -2471,6 +2689,12 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.20.7"
|
||||
|
@ -2753,6 +2977,16 @@ version = "0.5.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||
|
||||
[[package]]
|
||||
name = "spirv"
|
||||
version = "0.2.0+1.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
|
@ -2809,6 +3043,15 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.38"
|
||||
|
@ -3066,6 +3309,15 @@ dependencies = [
|
|||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "type-map"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f"
|
||||
dependencies = [
|
||||
"rustc-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
version = "0.3.8"
|
||||
|
@ -3387,6 +3639,100 @@ dependencies = [
|
|||
"webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81f643110d228fd62a60c5ed2ab56c4d5b3704520bd50561174ec4ec74932937"
|
||||
dependencies = [
|
||||
"arrayvec 0.7.2",
|
||||
"js-sys",
|
||||
"log",
|
||||
"naga",
|
||||
"parking_lot",
|
||||
"raw-window-handle 0.5.0",
|
||||
"smallvec",
|
||||
"static_assertions",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"wgpu-core",
|
||||
"wgpu-hal",
|
||||
"wgpu-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-core"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6000d1284ef8eec6076fd5544a73125fd7eb9b635f18dceeb829d826f41724ca"
|
||||
dependencies = [
|
||||
"arrayvec 0.7.2",
|
||||
"bit-vec",
|
||||
"bitflags",
|
||||
"cfg_aliases",
|
||||
"codespan-reporting",
|
||||
"fxhash",
|
||||
"log",
|
||||
"naga",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle 0.5.0",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"web-sys",
|
||||
"wgpu-hal",
|
||||
"wgpu-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-hal"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"arrayvec 0.7.2",
|
||||
"ash",
|
||||
"bit-set",
|
||||
"bitflags",
|
||||
"block",
|
||||
"core-graphics-types",
|
||||
"d3d12",
|
||||
"foreign-types 0.3.2",
|
||||
"fxhash",
|
||||
"glow",
|
||||
"gpu-alloc",
|
||||
"gpu-descriptor",
|
||||
"js-sys",
|
||||
"khronos-egl",
|
||||
"libloading",
|
||||
"log",
|
||||
"metal",
|
||||
"naga",
|
||||
"objc",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"range-alloc",
|
||||
"raw-window-handle 0.5.0",
|
||||
"renderdoc-sys",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
"wgpu-types",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-types"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
|
|
@ -16,13 +16,17 @@ publish = false
|
|||
lto = "thin"
|
||||
strip = "debuginfo"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
wgpu = ["eframe/wgpu"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.68"
|
||||
bytes = "1.3.0"
|
||||
cfg-if = "1.0.0"
|
||||
const_format = "0.2.30"
|
||||
cwdemangle = "0.1.4"
|
||||
eframe = { version = "0.20.1", features = ["persistence"] } # , "wgpu"
|
||||
eframe = { version = "0.20.1", features = ["persistence"] }
|
||||
egui = "0.20.1"
|
||||
egui_extras = "0.20.0"
|
||||
flagset = "0.4.3"
|
||||
|
|
|
@ -58,7 +58,7 @@ const DEFAULT_COLOR_ROTATION: [Color32; 9] = [
|
|||
Color32::from_rgb(255, 192, 203),
|
||||
Color32::from_rgb(0, 0, 255),
|
||||
Color32::from_rgb(0, 255, 0),
|
||||
Color32::from_rgb(128, 128, 128),
|
||||
Color32::from_rgb(213, 138, 138),
|
||||
];
|
||||
|
||||
#[derive(serde::Deserialize, serde::Serialize)]
|
||||
|
@ -67,14 +67,16 @@ pub struct ViewConfig {
|
|||
pub ui_font: FontId,
|
||||
pub code_font: FontId,
|
||||
pub diff_colors: Vec<Color32>,
|
||||
pub reverse_fn_order: bool,
|
||||
}
|
||||
|
||||
impl Default for ViewConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
ui_font: FontId { size: 14.0, family: FontFamily::Proportional },
|
||||
ui_font: FontId { size: 12.0, family: FontFamily::Proportional },
|
||||
code_font: FontId { size: 14.0, family: FontFamily::Monospace },
|
||||
diff_colors: DEFAULT_COLOR_ROTATION.to_vec(),
|
||||
reverse_fn_order: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +115,6 @@ pub struct ViewState {
|
|||
pub check_update: Option<Box<CheckUpdateResult>>,
|
||||
// Config
|
||||
pub diff_kind: DiffKind,
|
||||
pub reverse_fn_order: bool,
|
||||
pub view_config: ViewConfig,
|
||||
}
|
||||
|
||||
|
@ -133,7 +134,6 @@ impl Default for ViewState {
|
|||
utc_offset: UtcOffset::UTC,
|
||||
check_update: None,
|
||||
diff_kind: Default::default(),
|
||||
reverse_fn_order: false,
|
||||
view_config: Default::default(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,8 +268,8 @@ fn arg_eq(
|
|||
right_diff.ins.as_ref().and_then(|i| i.reloc.as_ref()),
|
||||
)
|
||||
}
|
||||
ObjInsArg::MipsArg(ls) => {
|
||||
matches!(right, ObjInsArg::MipsArg(rs) if ls == rs)
|
||||
ObjInsArg::MipsArg(ls) | ObjInsArg::MipsArgWithBase(ls) => {
|
||||
matches!(right, ObjInsArg::MipsArg(rs) | ObjInsArg::MipsArgWithBase(rs) if ls == rs)
|
||||
}
|
||||
ObjInsArg::BranchOffset(_) => {
|
||||
// Compare dest instruction idx after diffing
|
||||
|
@ -324,7 +324,7 @@ fn compare_ins(
|
|||
let a_str = match a {
|
||||
ObjInsArg::PpcArg(arg) => format!("{arg}"),
|
||||
ObjInsArg::Reloc | ObjInsArg::RelocWithBase => String::new(),
|
||||
ObjInsArg::MipsArg(str) => str.clone(),
|
||||
ObjInsArg::MipsArg(str) | ObjInsArg::MipsArgWithBase(str) => str.clone(),
|
||||
ObjInsArg::BranchOffset(arg) => format!("{arg}"),
|
||||
};
|
||||
let a_diff = if let Some(idx) = state.left_args_idx.get(&a_str) {
|
||||
|
@ -338,7 +338,7 @@ fn compare_ins(
|
|||
let b_str = match b {
|
||||
ObjInsArg::PpcArg(arg) => format!("{arg}"),
|
||||
ObjInsArg::Reloc | ObjInsArg::RelocWithBase => String::new(),
|
||||
ObjInsArg::MipsArg(str) => str.clone(),
|
||||
ObjInsArg::MipsArg(str) | ObjInsArg::MipsArgWithBase(str) => str.clone(),
|
||||
ObjInsArg::BranchOffset(arg) => format!("{arg}"),
|
||||
};
|
||||
let b_diff = if let Some(idx) = state.right_args_idx.get(&b_str) {
|
||||
|
|
|
@ -42,10 +42,7 @@ pub struct LevEditOp {
|
|||
|
||||
pub fn editops_find<T>(query: &[T], choice: &[T]) -> Vec<LevEditOp>
|
||||
where T: PartialEq {
|
||||
let Affix {
|
||||
prefix_len,
|
||||
suffix_len,
|
||||
} = Affix::find(query, choice);
|
||||
let Affix { prefix_len, suffix_len } = Affix::find(query, choice);
|
||||
|
||||
let first_string = &query[prefix_len..query.len() - suffix_len];
|
||||
let second_string = &choice[prefix_len..choice.len() - suffix_len];
|
||||
|
@ -185,19 +182,14 @@ pub struct Affix {
|
|||
impl Affix {
|
||||
pub fn find<T>(s1: &[T], s2: &[T]) -> Affix
|
||||
where T: PartialEq {
|
||||
let prefix_len = s1.iter()
|
||||
.zip(s2.iter())
|
||||
.take_while(|t| t.0 == t.1)
|
||||
.count();
|
||||
let suffix_len = s1[prefix_len..].iter()
|
||||
let prefix_len = s1.iter().zip(s2.iter()).take_while(|t| t.0 == t.1).count();
|
||||
let suffix_len = s1[prefix_len..]
|
||||
.iter()
|
||||
.rev()
|
||||
.zip(s2[prefix_len..].iter().rev())
|
||||
.take_while(|t| t.0 == t.1)
|
||||
.count();
|
||||
|
||||
Affix {
|
||||
prefix_len,
|
||||
suffix_len,
|
||||
}
|
||||
Affix { prefix_len, suffix_len }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,10 @@ fn main() {
|
|||
log::warn!("Failed to load application icon: {}", e);
|
||||
}
|
||||
}
|
||||
// native_options.renderer = eframe::Renderer::Wgpu;
|
||||
#[cfg(feature = "wgpu")]
|
||||
{
|
||||
native_options.renderer = eframe::Renderer::Wgpu;
|
||||
}
|
||||
eframe::run_native(
|
||||
"objdiff",
|
||||
native_options,
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
use std::{collections::BTreeMap, fs, io::Cursor, path::Path};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use anyhow::{anyhow, bail, Context, Result};
|
||||
use byteorder::{BigEndian, ReadBytesExt};
|
||||
use cwdemangle::demangle;
|
||||
use flagset::Flags;
|
||||
use object::{
|
||||
elf::{
|
||||
R_MIPS_26, R_MIPS_HI16, R_MIPS_LO16, R_PPC_ADDR16_HA, R_PPC_ADDR16_HI, R_PPC_ADDR16_LO,
|
||||
R_PPC_EMB_SDA21, R_PPC_REL14, R_PPC_REL24,
|
||||
},
|
||||
Architecture, File, Object, ObjectSection, ObjectSymbol, RelocationKind, RelocationTarget,
|
||||
elf, Architecture, File, Object, ObjectSection, ObjectSymbol, RelocationKind, RelocationTarget,
|
||||
SectionIndex, SectionKind, Symbol, SymbolKind, SymbolSection,
|
||||
};
|
||||
|
||||
|
@ -207,12 +203,12 @@ fn relocations_by_section(
|
|||
RelocationKind::Absolute => ObjRelocKind::Absolute,
|
||||
RelocationKind::Elf(kind) => match arch {
|
||||
ObjArchitecture::PowerPc => match kind {
|
||||
R_PPC_ADDR16_LO => ObjRelocKind::PpcAddr16Lo,
|
||||
R_PPC_ADDR16_HI => ObjRelocKind::PpcAddr16Hi,
|
||||
R_PPC_ADDR16_HA => ObjRelocKind::PpcAddr16Ha,
|
||||
R_PPC_REL24 => ObjRelocKind::PpcRel24,
|
||||
R_PPC_REL14 => ObjRelocKind::PpcRel14,
|
||||
R_PPC_EMB_SDA21 => ObjRelocKind::PpcEmbSda21,
|
||||
elf::R_PPC_ADDR16_LO => ObjRelocKind::PpcAddr16Lo,
|
||||
elf::R_PPC_ADDR16_HI => ObjRelocKind::PpcAddr16Hi,
|
||||
elf::R_PPC_ADDR16_HA => ObjRelocKind::PpcAddr16Ha,
|
||||
elf::R_PPC_REL24 => ObjRelocKind::PpcRel24,
|
||||
elf::R_PPC_REL14 => ObjRelocKind::PpcRel14,
|
||||
elf::R_PPC_EMB_SDA21 => ObjRelocKind::PpcEmbSda21,
|
||||
_ => {
|
||||
return Err(anyhow::Error::msg(format!(
|
||||
"Unhandled PPC relocation type: {kind}"
|
||||
|
@ -220,14 +216,14 @@ fn relocations_by_section(
|
|||
}
|
||||
},
|
||||
ObjArchitecture::Mips => match kind {
|
||||
R_MIPS_26 => ObjRelocKind::Mips26,
|
||||
R_MIPS_HI16 => ObjRelocKind::MipsHi16,
|
||||
R_MIPS_LO16 => ObjRelocKind::MipsLo16,
|
||||
_ => {
|
||||
return Err(anyhow::Error::msg(format!(
|
||||
"Unhandled MIPS relocation type: {kind}"
|
||||
)))
|
||||
}
|
||||
elf::R_MIPS_26 => ObjRelocKind::Mips26,
|
||||
elf::R_MIPS_HI16 => ObjRelocKind::MipsHi16,
|
||||
elf::R_MIPS_LO16 => ObjRelocKind::MipsLo16,
|
||||
elf::R_MIPS_GOT16 => ObjRelocKind::MipsGot16,
|
||||
elf::R_MIPS_CALL16 => ObjRelocKind::MipsCall16,
|
||||
elf::R_MIPS_GPREL16 => ObjRelocKind::MipsGpRel16,
|
||||
elf::R_MIPS_GPREL32 => ObjRelocKind::MipsGpRel32,
|
||||
_ => bail!("Unhandled MIPS relocation type: {kind}"),
|
||||
},
|
||||
},
|
||||
_ => {
|
||||
|
@ -244,37 +240,36 @@ fn relocations_by_section(
|
|||
}
|
||||
_ => None,
|
||||
};
|
||||
// println!("Reloc: {:?}, symbol: {:?}", reloc, symbol);
|
||||
let addend = if reloc.has_implicit_addend() {
|
||||
let addend = u32::from_be_bytes(
|
||||
section.data[address as usize..address as usize + 4].try_into()?,
|
||||
);
|
||||
match kind {
|
||||
ObjRelocKind::Absolute => addend as i64,
|
||||
ObjRelocKind::MipsHi16 => ((addend & 0x0000FFFF) << 16) as i32 as i64,
|
||||
ObjRelocKind::MipsLo16
|
||||
| ObjRelocKind::MipsGot16
|
||||
| ObjRelocKind::MipsCall16
|
||||
| ObjRelocKind::MipsGpRel16 => (addend & 0x0000FFFF) as i16 as i64,
|
||||
ObjRelocKind::MipsGpRel32 => addend as i32 as i64,
|
||||
ObjRelocKind::Mips26 => ((addend & 0x03FFFFFF) << 2) as i64,
|
||||
_ => bail!("Unsupported implicit relocation {kind:?}"),
|
||||
}
|
||||
} else {
|
||||
reloc.addend()
|
||||
};
|
||||
// println!("Reloc: {reloc:?}, symbol: {symbol:?}, addend: {addend:#X}");
|
||||
let target = match symbol.kind() {
|
||||
SymbolKind::Text | SymbolKind::Data | SymbolKind::Label | SymbolKind::Unknown => {
|
||||
to_obj_symbol(obj_file, &symbol, reloc.addend())
|
||||
to_obj_symbol(obj_file, &symbol, addend)
|
||||
}
|
||||
SymbolKind::Section => {
|
||||
let addend = if reloc.has_implicit_addend() {
|
||||
let addend = u32::from_be_bytes(
|
||||
section.data[address as usize..address as usize + 4].try_into()?,
|
||||
);
|
||||
match kind {
|
||||
ObjRelocKind::Absolute => addend,
|
||||
ObjRelocKind::MipsHi16 | ObjRelocKind::MipsLo16 => addend & 0x0000FFFF,
|
||||
ObjRelocKind::Mips26 => (addend & 0x03FFFFFF) * 4,
|
||||
_ => todo!(),
|
||||
}
|
||||
} else {
|
||||
let addend = reloc.addend();
|
||||
if addend < 0 {
|
||||
return Err(anyhow::Error::msg(format!(
|
||||
"Negative addend in section reloc: {addend}"
|
||||
)));
|
||||
}
|
||||
addend as u32
|
||||
};
|
||||
if addend < 0 {
|
||||
return Err(anyhow::Error::msg(format!("Negative addend in reloc: {addend}")));
|
||||
}
|
||||
find_section_symbol(obj_file, &symbol, addend as u64)
|
||||
}
|
||||
_ => Err(anyhow::Error::msg(format!(
|
||||
"Unhandled relocation symbol type {:?}",
|
||||
symbol.kind()
|
||||
))),
|
||||
kind => Err(anyhow!("Unhandled relocation symbol type {kind:?}")),
|
||||
}?;
|
||||
relocations.push(ObjReloc { kind, address, target, target_section });
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use rabbitizer::{config, Abi, Instruction, InstrCategory, OperandType};
|
||||
use rabbitizer::{config, Abi, InstrCategory, Instruction, OperandType};
|
||||
|
||||
use crate::obj::{ObjIns, ObjInsArg, ObjReloc};
|
||||
|
||||
|
@ -37,37 +37,49 @@ pub fn process_code(
|
|||
let branch_offset = instruction.branch_offset();
|
||||
let branch_dest =
|
||||
if is_branch { Some((cur_addr as i32 + branch_offset) as u32) } else { None };
|
||||
let args = instruction
|
||||
.get_operands_slice()
|
||||
.iter()
|
||||
.map(|op| match op {
|
||||
OperandType::cpu_immediate | OperandType::cpu_label | OperandType::cpu_branch_target_label => {
|
||||
|
||||
let operands = instruction.get_operands_slice();
|
||||
let mut args = Vec::with_capacity(operands.len() + 1);
|
||||
for op in operands {
|
||||
match op {
|
||||
OperandType::cpu_immediate
|
||||
| OperandType::cpu_label
|
||||
| OperandType::cpu_branch_target_label => {
|
||||
if is_branch {
|
||||
ObjInsArg::BranchOffset(branch_offset)
|
||||
args.push(ObjInsArg::BranchOffset(branch_offset));
|
||||
} else if let Some(reloc) = reloc {
|
||||
if matches!(&reloc.target_section, Some(s) if s == ".text")
|
||||
&& reloc.target.address > start_address
|
||||
&& reloc.target.address < end_address
|
||||
{
|
||||
// Inter-function reloc, convert to branch offset
|
||||
ObjInsArg::BranchOffset(reloc.target.address as i32 - cur_addr as i32)
|
||||
args.push(ObjInsArg::BranchOffset(
|
||||
reloc.target.address as i32 - cur_addr as i32,
|
||||
));
|
||||
} else {
|
||||
ObjInsArg::Reloc
|
||||
args.push(ObjInsArg::Reloc);
|
||||
}
|
||||
} else {
|
||||
ObjInsArg::MipsArg(op.disassemble(&instruction, None))
|
||||
args.push(ObjInsArg::MipsArg(op.disassemble(&instruction, None)));
|
||||
}
|
||||
}
|
||||
OperandType::cpu_immediate_base => {
|
||||
if reloc.is_some() {
|
||||
ObjInsArg::RelocWithBase
|
||||
args.push(ObjInsArg::RelocWithBase);
|
||||
} else {
|
||||
ObjInsArg::MipsArg(op.disassemble(&instruction, None))
|
||||
args.push(ObjInsArg::MipsArgWithBase(
|
||||
OperandType::cpu_immediate.disassemble(&instruction, None),
|
||||
));
|
||||
}
|
||||
args.push(ObjInsArg::MipsArg(
|
||||
OperandType::cpu_rs.disassemble(&instruction, None),
|
||||
));
|
||||
}
|
||||
_ => ObjInsArg::MipsArg(op.disassemble(&instruction, None)),
|
||||
})
|
||||
.collect();
|
||||
_ => {
|
||||
args.push(ObjInsArg::MipsArg(op.disassemble(&instruction, None)));
|
||||
}
|
||||
}
|
||||
}
|
||||
let line =
|
||||
line_info.as_ref().and_then(|map| map.range(..=cur_addr).last().map(|(_, &b)| b));
|
||||
insts.push(ObjIns {
|
||||
|
|
|
@ -41,6 +41,7 @@ pub struct ObjSection {
|
|||
pub enum ObjInsArg {
|
||||
PpcArg(ppc750cl::Argument),
|
||||
MipsArg(String),
|
||||
MipsArgWithBase(String),
|
||||
Reloc,
|
||||
RelocWithBase,
|
||||
BranchOffset(i32),
|
||||
|
@ -158,6 +159,10 @@ pub enum ObjRelocKind {
|
|||
Mips26,
|
||||
MipsHi16,
|
||||
MipsLo16,
|
||||
MipsGot16,
|
||||
MipsCall16,
|
||||
MipsGpRel16,
|
||||
MipsGpRel32,
|
||||
}
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ObjReloc {
|
||||
|
|
|
@ -247,6 +247,6 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
|
|||
}
|
||||
}
|
||||
|
||||
ui.checkbox(&mut view_state.reverse_fn_order, "Reverse function order (deferred)");
|
||||
ui.checkbox(&mut view_state.view_config.reverse_fn_order, "Reverse function order (deferred)");
|
||||
ui.separator();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::default::Default;
|
||||
use std::{cmp::Ordering, default::Default};
|
||||
|
||||
use cwdemangle::demangle;
|
||||
use eframe::emath::Align;
|
||||
|
@ -20,8 +20,14 @@ use crate::{
|
|||
fn write_reloc_name(reloc: &ObjReloc, color: Color32, job: &mut LayoutJob, font_id: FontId) {
|
||||
let name = reloc.target.demangled_name.as_ref().unwrap_or(&reloc.target.name);
|
||||
write_text(name, Color32::LIGHT_GRAY, job, font_id.clone());
|
||||
if reloc.target.addend != 0 {
|
||||
write_text(&format!("+{:X}", reloc.target.addend), color, job, font_id);
|
||||
match reloc.target.addend.cmp(&0i64) {
|
||||
Ordering::Greater => {
|
||||
write_text(&format!("+{:#X}", reloc.target.addend), color, job, font_id)
|
||||
}
|
||||
Ordering::Less => {
|
||||
write_text(&format!("-{:#X}", -reloc.target.addend), color, job, font_id);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,12 +59,27 @@ fn write_reloc(reloc: &ObjReloc, color: Color32, job: &mut LayoutJob, font_id: F
|
|||
write_reloc_name(reloc, color, job, font_id.clone());
|
||||
write_text(")", color, job, font_id);
|
||||
}
|
||||
ObjRelocKind::Absolute
|
||||
| ObjRelocKind::PpcRel24
|
||||
| ObjRelocKind::PpcRel14
|
||||
| ObjRelocKind::Mips26 => {
|
||||
ObjRelocKind::MipsGot16 => {
|
||||
write_text("%got(", color, job, font_id.clone());
|
||||
write_reloc_name(reloc, color, job, font_id.clone());
|
||||
write_text(")", color, job, font_id);
|
||||
}
|
||||
ObjRelocKind::MipsCall16 => {
|
||||
write_text("%call16(", color, job, font_id.clone());
|
||||
write_reloc_name(reloc, color, job, font_id.clone());
|
||||
write_text(")", color, job, font_id);
|
||||
}
|
||||
ObjRelocKind::MipsGpRel16 => {
|
||||
write_text("%gp_rel(", color, job, font_id.clone());
|
||||
write_reloc_name(reloc, color, job, font_id.clone());
|
||||
write_text(")", color, job, font_id);
|
||||
}
|
||||
ObjRelocKind::PpcRel24 | ObjRelocKind::PpcRel14 | ObjRelocKind::Mips26 => {
|
||||
write_reloc_name(reloc, color, job, font_id);
|
||||
}
|
||||
ObjRelocKind::Absolute | ObjRelocKind::MipsGpRel32 => {
|
||||
write_text("[INVALID]", color, job, font_id);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -132,6 +153,17 @@ fn write_ins(
|
|||
config.code_font.clone(),
|
||||
);
|
||||
}
|
||||
ObjInsArg::MipsArgWithBase(str) => {
|
||||
write_text(
|
||||
str.strip_prefix('$').unwrap_or(str),
|
||||
color,
|
||||
job,
|
||||
config.code_font.clone(),
|
||||
);
|
||||
write_text("(", base_color, job, config.code_font.clone());
|
||||
writing_offset = true;
|
||||
continue;
|
||||
}
|
||||
ObjInsArg::BranchOffset(offset) => {
|
||||
let addr = offset + ins.address as i32 - base_addr as i32;
|
||||
write_text(&format!("{addr:x}"), color, job, config.code_font.clone());
|
||||
|
|
|
@ -135,7 +135,6 @@ fn symbol_list_ui(
|
|||
highlighted_symbol: &mut Option<String>,
|
||||
selected_symbol: &mut Option<SymbolReference>,
|
||||
current_view: &mut View,
|
||||
reverse_function_order: bool,
|
||||
lower_search: &str,
|
||||
config: &ViewConfig,
|
||||
) {
|
||||
|
@ -164,7 +163,7 @@ fn symbol_list_ui(
|
|||
CollapsingHeader::new(format!("{} ({:x})", section.name, section.size))
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
if section.kind == ObjSectionKind::Code && reverse_function_order {
|
||||
if section.kind == ObjSectionKind::Code && config.reverse_fn_order {
|
||||
for symbol in section.symbols.iter().rev() {
|
||||
if !symbol_matches_search(symbol, lower_search) {
|
||||
continue;
|
||||
|
@ -292,7 +291,6 @@ pub fn symbol_diff_ui(ui: &mut Ui, view_state: &mut ViewState) {
|
|||
highlighted_symbol,
|
||||
selected_symbol,
|
||||
current_view,
|
||||
view_state.reverse_fn_order,
|
||||
&lower_search,
|
||||
&view_state.view_config,
|
||||
);
|
||||
|
@ -312,7 +310,6 @@ pub fn symbol_diff_ui(ui: &mut Ui, view_state: &mut ViewState) {
|
|||
highlighted_symbol,
|
||||
selected_symbol,
|
||||
current_view,
|
||||
view_state.reverse_fn_order,
|
||||
&lower_search,
|
||||
&view_state.view_config,
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue