mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Fix memory breakpoint when checking the middle of the data
If the delimiters of a memory aren't exactly the same as an address, but their size includes the memory breakpoint delimiter, the break will not go through. This makes it so that you can specify a search for a memory breakpoint with a data size and will check if the data fits with that size on all memory breakpoints so the breaks go through.
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include "Core/PowerPC/BreakPoints.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -201,16 +202,11 @@ void MemChecks::Remove(u32 address)
|
||||
}
|
||||
}
|
||||
|
||||
TMemCheck* MemChecks::GetMemCheck(u32 address)
|
||||
TMemCheck* MemChecks::GetMemCheck(u32 address, size_t size)
|
||||
{
|
||||
for (TMemCheck& mc : m_mem_checks)
|
||||
{
|
||||
if (mc.is_ranged)
|
||||
{
|
||||
if (address >= mc.start_address && address <= mc.end_address)
|
||||
return &mc;
|
||||
}
|
||||
else if (mc.start_address == address)
|
||||
if (mc.end_address >= address && address + size - 1 >= mc.start_address)
|
||||
{
|
||||
return &mc;
|
||||
}
|
||||
@ -239,8 +235,8 @@ bool MemChecks::OverlapsMemcheck(u32 address, u32 length)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TMemCheck::Action(DebugInterface* debug_interface, u32 value, u32 addr, bool write, int size,
|
||||
u32 pc)
|
||||
bool TMemCheck::Action(DebugInterface* debug_interface, u32 value, u32 addr, bool write,
|
||||
size_t size, u32 pc)
|
||||
{
|
||||
if ((write && is_break_on_write) || (!write && is_break_on_read))
|
||||
{
|
||||
|
Reference in New Issue
Block a user