From f386ab7d6ee0fc8e29cace56837a10f159ac460f Mon Sep 17 00:00:00 2001 From: malco <56635871+salon64@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:31:36 +0200 Subject: [PATCH 1/2] resolved open issue and fixed other ui problems --- mips-lib/mips_single_cycle.json | 4 +-- mips-lib/src/gui_egui/mips_mem_view_window.rs | 31 ++++++++++++++----- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/mips-lib/mips_single_cycle.json b/mips-lib/mips_single_cycle.json index 859fa0a..f94af5b 100644 --- a/mips-lib/mips_single_cycle.json +++ b/mips-lib/mips_single_cycle.json @@ -196,8 +196,8 @@ "type": "PhysicalMem", "id": "phys_mem", "pos": [ - 0.0, - 0.0 + 425.0, + 575.0 ] }, { diff --git a/mips-lib/src/gui_egui/mips_mem_view_window.rs b/mips-lib/src/gui_egui/mips_mem_view_window.rs index 0fa4f66..f9f9c79 100644 --- a/mips-lib/src/gui_egui/mips_mem_view_window.rs +++ b/mips-lib/src/gui_egui/mips_mem_view_window.rs @@ -234,6 +234,10 @@ impl MemViewWindow { // add submenu with a button for each symbol, which sets self.go_to_address ui.menu_button("symbol", |ui| { + let because_lifetimes_sad = mem.get_symbol_table(); + let mut sections = because_lifetimes_sad.iter().collect::>(); + sections.sort_by(|a, b| a.0.partial_cmp(b.0).unwrap()); + ScrollArea::vertical().show(ui, |ui| { let because_lifetimes_sad = mem.get_symbol_table(); let mut symbols = because_lifetimes_sad.iter().collect::>(); @@ -253,13 +257,26 @@ impl MemViewWindow { let mut sections = because_lifetimes_sad.iter().collect::>(); sections.sort_by(|a, b| a.0.partial_cmp(b.0).unwrap()); - for (key, v) in sections { - if ui.button(format!("{} {:#0x}", v, key)).clicked() { - self.go_to_address = set_address(&self.go_type, *key); - ui.close_menu(); - close_menu = true; + // for (key, v) in sections { + // if ui.button(format!("{} {:#0x}", v, key)).clicked() { + // self.go_to_address = set_address(&self.go_type, *key); + // ui.close_menu(); + // close_menu = true; + // } + // } + ScrollArea::vertical().show(ui, |ui| { + let because_lifetimes_sad = mem.get_section_table(); + let mut section = because_lifetimes_sad.iter().collect::>(); + section.sort_by(|a, b| a.0.partial_cmp(b.0).unwrap()); + + for (key, v) in section { + if ui.button(format!("{} {:#0x}", v, key)).clicked() { + self.go_to_address = set_address(&self.go_type, *key); + ui.close_menu(); + close_menu = true; + } } - } + }); }); // Does any PC pointer exists, make them visible in this menu for quick access @@ -484,7 +501,7 @@ impl MemViewWindow { } DataFormat::HexAndMips => { format!( - "{:#010x} {:015}", + "{:#010x} {:015}", data_u32, MIPS_disassembly::get_disassembly_adv( data_u32, From adcb567cff577469ff6020cac0aaca6a45bc6732 Mon Sep 17 00:00:00 2001 From: malco <56635871+salon64@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:32:45 +0200 Subject: [PATCH 2/2] set the mips dissasembly to a working version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 161828c..dbc996c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" members = [ "mips-lib", "riscv"] [dependencies] -MIPS_disassembly = "0.1.2" +MIPS_disassembly = "=0.1.3" anyhow = "1.0.72" clap = { version = "4.3.15", features = ["derive"] } elf = "0.7.4"