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" 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,