From 4f74d1400180ca4ad7cfcd1903386fda8779818d Mon Sep 17 00:00:00 2001 From: hachem Date: Fri, 18 Sep 2026 12:25:58 +0200 Subject: feat: improve layout and themes --- src/ui/ui.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/ui/ui.h') diff --git a/src/ui/ui.h b/src/ui/ui.h index a404fc1..8c221a7 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include namespace Hsdbg @@ -85,6 +87,9 @@ namespace Hsdbg auto draw_menu_bar(Debugger& debugger) -> void; auto draw_toolbar(Debugger& debugger) -> void; + + // f5 / f10 / f11 / shift+f11, the keys the run menu advertises + auto handle_shortcuts(Debugger& debugger) -> void; auto draw_status_bar(const Debugger& debugger) -> void; auto draw_load_target_popup(Debugger& debugger) -> void; auto draw_preferences_window() -> void; @@ -118,6 +123,10 @@ namespace Hsdbg auto follow_stop(Debugger& debugger) -> void; auto follow_target(Debugger& debugger) -> void; + // records the locals and registers of the selected frame at each stop so + // the panels can pick out what changed since the last one + auto snapshot_values(const Debugger& debugger) -> void; + // selects the innermost frame that has source and shows it, so a new // thread or stop lands the whole ui on real code rather than a runtime // internal frame with nothing to display @@ -140,6 +149,7 @@ namespace Hsdbg // opens so newly dropped-in files appear) Theme m_theme; std::vector m_themes; + std::vector m_theme_previews; // one palette per entry, for the picker's cards bool m_prefs_open_prev = false; // the bundled faces, all with Phosphor icons merged in: ui is Nunito (its @@ -176,6 +186,7 @@ namespace Hsdbg std::string expression; std::string value; bool ok = false; + bool changed = false; // moved since the previous evaluation }; std::vector m_watches; @@ -206,6 +217,20 @@ namespace Hsdbg uint64_t m_followed_stop = 0; std::filesystem::path m_followed_target; + // the values seen at the previous and current stop, locals keyed by their + // dotted path; comparable only while the stop landed in the same thread, + // frame and function as the last one, else nothing is flagged + std::unordered_map m_prev_locals; + std::unordered_map m_curr_locals; + std::unordered_map m_prev_registers; + std::unordered_map m_curr_registers; + std::unordered_set m_changed_locals; // top-level names that moved, for the source view + std::string m_snapshot_function; + uint64_t m_snapshot_stop = 0; + uint64_t m_snapshot_thread = 0; + uint32_t m_snapshot_frame = 0; + bool m_snapshot_comparable = false; + // the source file whose folder chain the tree last expanded; when the // open file moves away from it the tree reveals the new path once std::filesystem::path m_revealed_source; -- cgit v1.3