Add memory.search and hle.data.* to the WebSocket debugger

Reverse-engineering workflows need to (1) find where an unknown value lives
in memory and (2) label what's found, neither of which the debugger API
could do before:

- memory.search (MemorySubscriber.cpp): Cheat-Engine-style scan of a memory
  range for a u8/u16/u32/float value, or a byte pattern with an optional
  wildcard mask.
- hle.data.list/add/remove/rename (HLESubscriber.cpp): manage ST_DATA
  symbols (structs, tables, buffers), mirroring the existing hle.func.*
  commands for functions. Needed a new SymbolMap::RemoveData, since only
  RemoveFunction existed - added following the same pattern.

Verified live against a running PPSSPP instance (game.status, cpu.stepping,
memory.search in u32/bytes/masked-bytes modes, and the full
add/list/rename/remove data-symbol lifecycle) via Tools/wsdbg.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDNwPPuidmNxQGRJxBuRL6
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-07-26 21:17:09 +02:00
1 parent 3ebc9872a5
commit 074c8ac523
7 files changed
+367

No files matched your search

+32
View File
@@ -1109,6 +1109,38 @@ DataType SymbolMap::GetDataType(u32 startAddress) {
return it->second.type;
}
bool SymbolMap::RemoveData(u32 startAddress, bool removeName) {
if (activeNeedUpdate_)
UpdateActiveSymbols();
std::lock_guard<std::recursive_mutex> guard(lock_);
auto it = activeData.find(startAddress);
if (it == activeData.end())
return false;
auto symbolKey = std::make_pair(it->second.module, it->second.start);
auto it2 = data.find(symbolKey);
if (it2 != data.end()) {
data.erase(it2);
}
activeData.erase(it);
if (removeName) {
auto labelIt = activeLabels.find(startAddress);
if (labelIt != activeLabels.end()) {
symbolKey = std::make_pair(labelIt->second.module, labelIt->second.addr);
auto labelIt2 = labels.find(symbolKey);
if (labelIt2 != labels.end()) {
labels.erase(labelIt2);
}
activeLabels.erase(labelIt);
}
}
return true;
}
void SymbolMap::GetLabels(std::vector<LabelDefinition> &dest) {
if (activeNeedUpdate_)
UpdateActiveSymbols();