aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-18 12:25:58 +0200
committerhachem <im@hachem.wtf>2026-09-18 12:25:58 +0200
commit4f74d1400180ca4ad7cfcd1903386fda8779818d (patch)
tree258a332c3076045461b5d6f8592a52140225abd1 /src/ui/ui.h
parent0846724177d823b632f2a4deffdcb5b6e226cd56 (diff)
feat: improve layout and themes
Diffstat (limited to 'src/ui/ui.h')
-rw-r--r--src/ui/ui.h25
1 files changed, 25 insertions, 0 deletions
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 <filesystem>
#include <string>
#include <string_view>
+#include <unordered_map>
+#include <unordered_set>
#include <vector>
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<ThemeEntry> m_themes;
+ std::vector<Theme> 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<Watch> 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<std::string, std::string> m_prev_locals;
+ std::unordered_map<std::string, std::string> m_curr_locals;
+ std::unordered_map<std::string, uint64_t> m_prev_registers;
+ std::unordered_map<std::string, uint64_t> m_curr_registers;
+ std::unordered_set<std::string> 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;