Ok, i looked now a bit more, and i have some suggestions:
1) Update the memory range only once, like the watches:
diff --git a/src/plugins/debuggergdb/gdb_driver.cpp b/src/plugins/debuggergdb/gdb_driver.cpp
index e844ad69d..f4797e563 100644
--- a/src/plugins/debuggergdb/gdb_driver.cpp
+++ b/src/plugins/debuggergdb/gdb_driver.cpp
@@ -692,14 +692,18 @@ void GDB_driver::UpdateWatches(cb::shared_ptr<GDBWatch> localsWatch, cb::shared_
void GDB_driver::UpdateMemoryRangeWatches(MemoryRangeWatchesContainer &watches)
{
+ bool updateWatches = false;
for (cb::shared_ptr<GDBMemoryRangeWatch> &watch : watches)
{
if (watch->IsAutoUpdateEnabled())
{
QueueCommand(new GdbCmd_MemoryRangeWatch(this, watch));
- QueueCommand(new DbgCmd_UpdateWindow(this, cbDebuggerPlugin::DebugWindows::MemoryRange));
+ updateWatches = true;
}
}
+
+ if(updateWatches)
+ QueueCommand(new DbgCmd_UpdateWindow(this, cbDebuggerPlugin::DebugWindows::MemoryRange));
}
void GDB_driver::UpdateWatch(const cb::shared_ptr<GDBWatch> &watch)
2) It would be cool to have a function, to add a bulk of watches, or to tell the DebuggerGDB::AddMemoryRange function to not perform an update right now (DebuggerGDB::AddMemoryRange(uint64_t address, uint64_t size, const wxString &symbol, bool update = true)). The reason is, if i add a lot watches (like expanding the whole svd register tree at once) i get 1000 of update events (effectively for every memory range i add one). One possibility to solve this would be to pack all registers to one big memory watch, but i do not think that this is possible. The registers can have spaces between the memory ranges so that they can not be collected in one big memory range. This is not a show stopper for now, but it would be nice to have it in mind... This probably could also be helpful for the normal watches...
[edit:] About 2) if we extend AddMemoryRange with the not update parameter, probably a function to perform an update now would also be a nice to have (but not a necessity)