Debugger: Ignore unmarked mem block info in find.

We start with a large unmarked region which we break up.  Ignore this.
This commit is contained in:
Unknown W. Brackets 2021-02-07 11:00:13 -08:00
parent 616850663c
commit 595a17e9bc
2 changed files with 20 additions and 2 deletions

View File

@ -128,8 +128,10 @@ bool MemSlabMap::Find(MemBlockFlags flags, uint32_t addr, uint32_t size, std::ve
Slab *slab = FindSlab(addr);
bool found = false;
while (slab != nullptr && slab->start < end) {
results.push_back({ flags, slab->start, slab->end - slab->start, slab->pc, slab->tag, slab->allocated });
found = true;
if (slab->pc != 0 || !slab->tag.empty()) {
results.push_back({ flags, slab->start, slab->end - slab->start, slab->pc, slab->tag, slab->allocated });
found = true;
}
slab = slab->next;
}
return found;
@ -378,6 +380,21 @@ std::vector<MemBlockInfo> FindMemInfo(uint32_t start, uint32_t size) {
return results;
}
std::vector<MemBlockInfo> FindMemInfoByFlag(MemBlockFlags flags, uint32_t start, uint32_t size) {
FlushPendingMemInfo();
std::vector<MemBlockInfo> results;
if (flags & MemBlockFlags::ALLOC)
allocMap.Find(MemBlockFlags::ALLOC, start, size, results);
if (flags & MemBlockFlags::SUB_ALLOC)
suballocMap.Find(MemBlockFlags::SUB_ALLOC, start, size, results);
if (flags & MemBlockFlags::WRITE)
writeMap.Find(MemBlockFlags::WRITE, start, size, results);
if (flags & MemBlockFlags::TEXTURE)
textureMap.Find(MemBlockFlags::TEXTURE, start, size, results);
return results;
}
void MemBlockInfoInit() {
pendingNotifies.reserve(MAX_PENDING_NOTIFIES);
}

View File

@ -49,6 +49,7 @@ void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const std
void NotifyMemInfoPC(MemBlockFlags flags, uint32_t start, uint32_t size, uint32_t pc, const std::string &tag);
std::vector<MemBlockInfo> FindMemInfo(uint32_t start, uint32_t size);
std::vector<MemBlockInfo> FindMemInfoByFlag(MemBlockFlags flags, uint32_t start, uint32_t size);
void MemBlockInfoInit();
void MemBlockInfoShutdown();