Debugger/Memory: Fix mem2 search #12193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Memory widget search functionality would not work for MEM2 region.
Match()
restricts our physical address from exceeding 0x01FFFFFF. This means that we can access cached/uncache MEM1 as our physical addresses are 0x00000000 - 0x017FFFFF. However, this logic does not work for MEM2, as our physical address is 0x10000000 to 0x117FFFFF (I believe). Searching starting from MEM2 does not show a match until 0xC0000000.At first I assumed we would just modify
memory_area
, however, the call toMMU::HostIsRAMAddress()
inEffectiveAddressSpaceAccessors::Search()
appears to sufficiently check for valid memory bounds. Notably, we want to allow RAM searches for instances where you increase the size of MEM1 or MEM2 via Config->Advanced tab. In these instances, the current code does not allow for the upper bound to increase, whereasHostIsRAMAddress()
eventually retrieves them_memory.GetRamSizeReal()
which factors in the possibly larger mem allocation.The comment in
Match()
implies concern regarding the dcache. In testing, we either pagefault inMMU::IsRAMAddress()
after the call toTranslateAddress()
OR we reachEffectiveAddressSpaceAccessors::Matches()
. In cases where we reachMatches()
, we can just change the physical address check to require that we are not at or beyond dcache.