From 99bdb4f18a37af603f5787a80c248292cd0cde77 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 9 Apr 2023 00:52:03 -0700 Subject: [PATCH] Debugger: Periodically refresh watches to be safe. --- Windows/Debugger/Debugger_Lists.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index 505db7176e..3455cc184a 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -816,10 +816,15 @@ void CtrlModuleList::loadModules() Update(); } +// In case you modify things in the memory view. +static constexpr UINT_PTR IDT_CHECK_REFRESH = 0xC0DE0044; + CtrlWatchList::CtrlWatchList(HWND hwnd, DebugInterface *cpu) : GenericListControl(hwnd, watchListDef), cpu_(cpu) { SetSendInvalidRows(true); Update(); + + SetTimer(GetHandle(), IDT_CHECK_REFRESH, 1000U, nullptr); } void CtrlWatchList::RefreshValues() { @@ -870,6 +875,12 @@ bool CtrlWatchList::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESUL } } break; + case WM_TIMER: + if (wParam == IDT_CHECK_REFRESH) { + RefreshValues(); + return true; + } + break; } return false;