mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-17 08:57:25 +00:00
Initial x86 support
Includes a bit of work to make adding new architectures easier in the future
This commit is contained in:
@@ -12,8 +12,11 @@ use std::{
|
||||
use filetime::FileTime;
|
||||
use globset::{Glob, GlobSet};
|
||||
use notify::{RecursiveMode, Watcher};
|
||||
use objdiff_core::config::{
|
||||
build_globset, ProjectConfigInfo, ProjectObject, ScratchConfig, DEFAULT_WATCH_PATTERNS,
|
||||
use objdiff_core::{
|
||||
config::{
|
||||
build_globset, ProjectConfigInfo, ProjectObject, ScratchConfig, DEFAULT_WATCH_PATTERNS,
|
||||
},
|
||||
diff::DiffObjConfig,
|
||||
};
|
||||
use time::UtcOffset;
|
||||
|
||||
@@ -26,7 +29,9 @@ use crate::{
|
||||
},
|
||||
views::{
|
||||
appearance::{appearance_window, Appearance},
|
||||
config::{config_ui, project_window, ConfigViewState, CONFIG_DISABLED_TEXT},
|
||||
config::{
|
||||
config_ui, diff_config_window, project_window, ConfigViewState, CONFIG_DISABLED_TEXT,
|
||||
},
|
||||
data_diff::data_diff_ui,
|
||||
debug::debug_window,
|
||||
demangle::{demangle_window, DemangleViewState},
|
||||
@@ -47,6 +52,7 @@ pub struct ViewState {
|
||||
pub show_appearance_config: bool,
|
||||
pub show_demangle: bool,
|
||||
pub show_project_config: bool,
|
||||
pub show_diff_config: bool,
|
||||
pub show_debug: bool,
|
||||
}
|
||||
|
||||
@@ -100,7 +106,7 @@ pub struct AppConfig {
|
||||
#[serde(default)]
|
||||
pub recent_projects: Vec<PathBuf>,
|
||||
#[serde(default)]
|
||||
pub relax_reloc_diffs: bool,
|
||||
pub diff_obj_config: DiffObjConfig,
|
||||
|
||||
#[serde(skip)]
|
||||
pub objects: Vec<ProjectObject>,
|
||||
@@ -138,7 +144,7 @@ impl Default for AppConfig {
|
||||
auto_update_check: true,
|
||||
watch_patterns: DEFAULT_WATCH_PATTERNS.iter().map(|s| Glob::new(s).unwrap()).collect(),
|
||||
recent_projects: vec![],
|
||||
relax_reloc_diffs: false,
|
||||
diff_obj_config: Default::default(),
|
||||
objects: vec![],
|
||||
object_nodes: vec![],
|
||||
watcher_change: false,
|
||||
@@ -408,6 +414,7 @@ impl eframe::App for App {
|
||||
show_appearance_config,
|
||||
show_demangle,
|
||||
show_project_config,
|
||||
show_diff_config,
|
||||
show_debug,
|
||||
} = view_state;
|
||||
|
||||
@@ -461,6 +468,10 @@ impl eframe::App for App {
|
||||
}
|
||||
});
|
||||
ui.menu_button("Diff Options", |ui| {
|
||||
if ui.button("More…").clicked() {
|
||||
*show_diff_config = !*show_diff_config;
|
||||
ui.close_menu();
|
||||
}
|
||||
let mut config = config.write().unwrap();
|
||||
let response = ui
|
||||
.checkbox(&mut config.rebuild_on_changes, "Rebuild on changes")
|
||||
@@ -481,7 +492,10 @@ impl eframe::App for App {
|
||||
"Show hidden symbols",
|
||||
);
|
||||
if ui
|
||||
.checkbox(&mut config.relax_reloc_diffs, "Relax relocation diffs")
|
||||
.checkbox(
|
||||
&mut config.diff_obj_config.relax_reloc_diffs,
|
||||
"Relax relocation diffs",
|
||||
)
|
||||
.on_hover_text(
|
||||
"Ignores differences in relocation targets. (Address, name, etc)",
|
||||
)
|
||||
@@ -489,6 +503,15 @@ impl eframe::App for App {
|
||||
{
|
||||
config.queue_reload = true;
|
||||
}
|
||||
if ui
|
||||
.checkbox(
|
||||
&mut config.diff_obj_config.space_between_args,
|
||||
"Space between args",
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
config.queue_reload = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -518,6 +541,7 @@ impl eframe::App for App {
|
||||
project_window(ctx, config, show_project_config, config_state, appearance);
|
||||
appearance_window(ctx, show_appearance_config, appearance);
|
||||
demangle_window(ctx, show_demangle, demangle_state, appearance);
|
||||
diff_config_window(ctx, config, show_diff_config, appearance);
|
||||
debug_window(ctx, show_debug, frame_history, appearance);
|
||||
|
||||
self.post_update(ctx);
|
||||
|
||||
Reference in New Issue
Block a user