From df0b107a4ab2a6120b2e829790b35110be972d13 Mon Sep 17 00:00:00 2001 From: Cay Date: Fri, 15 Mar 2024 13:33:23 -0400 Subject: [PATCH 01/21] Add Stack Segment view --- src/bin/main.rs | 19 +++---- src/emulation_core/mips/memory.rs | 45 ++++++---------- src/ui/assembled_view/component.rs | 85 ++++++++++++++++++++++++++---- src/ui/footer/component.rs | 49 +++++++---------- src/ui/hex_editor/component.rs | 7 ++- src/ui/swim_editor/component.rs | 45 +++++++--------- src/ui/swim_editor/tab.rs | 31 +++++++++++ 7 files changed, 174 insertions(+), 107 deletions(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index d624e7975..b9b80d666 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -18,11 +18,13 @@ use swim::ui::footer::component::Footer; use swim::ui::regview::component::Regview; use swim::ui::swim_editor::component::SwimEditor; use swim::{ - emulation_core::{architectures::AvailableDatapaths, mips::instruction::get_string_version}, + emulation_core::{ + architectures::AvailableDatapaths, mips::gp_registers::GpRegisterType, + mips::instruction::get_string_version, + }, ui::{ - footer::component::FooterTabState, hex_editor::component::{parse_hexdump, UpdatedLine}, - swim_editor::component::EditorTabState, + swim_editor::tab::TabState, }, }; use wasm_bindgen::{JsCast, JsValue}; @@ -81,8 +83,8 @@ fn app(props: &AppProps) -> Html { let command = use_state_eq(|| String::from("(Test) Enter a string")); // Store the currently selected tabs in windows - let console_active_tab = use_state_eq(FooterTabState::default); - let editor_active_tab = use_state_eq(|| EditorTabState::Editor); + let console_active_tab = use_state_eq(|| TabState::Console); + let editor_active_tab = use_state_eq(|| TabState::Editor); let datapath_state = use_reducer(DatapathReducer::default); @@ -91,7 +93,7 @@ fn app(props: &AppProps) -> Html { { let dispatcher = datapath_state.dispatcher(); use_effect_with_deps( - move |communicator| { + move |communicator: &&DatapathCommunicator| { spawn_local(communicator.listen_for_updates(dispatcher)); }, props.communicator, @@ -463,7 +465,6 @@ fn app(props: &AppProps) -> Html { ) }; - log::debug!("{:?}", datapath_state.executing); html! { <> // button tied to the input file element, which is hidden to be more clean @@ -522,11 +523,11 @@ fn app(props: &AppProps) -> Html { // Editor
- +
// Console -