Dolphin, the GameCube and Wii emulator - Forums

Full Version: Memory breakpoints don't break on correct PC?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

BLJRacer

Hi. I'm new to Dolphin and I don't know much PPC ASM. I don't know if this post belongs to this category (please move it if it doesn't).

Basically, I've found an interesting memory address in a game. I would like to read the code that uses the value on this zone, so I've compiled the DebugFast version of Dolphin (SVN R 5173M), set up the memory breakpoints, and switched the CPU to interpreter mode.
The game stops when the value changes, but it doesn't seem to break where the value changes. If I look at the value, it has already changed, and the previous instructions don't look like they're modifying that value.

Is that the expected behaviour? Am I missing something?
Yeh, there is a bit of a design fault with the memory breakpoints in Dolphin.

What I've done is to hack the code to log the PC as the WriteToHardware function is called.

BLJRacer

Thanks a lot, at least it works now.

If someone's having the same problem, here's what I did:

On the functions that check for breakpoints (look for WriteToHardware calls), add inside the "if (mc)" block:

Code:
DEBUG_LOG(MEMMAP, "Write_U8 to %.8X from PC %.8X (Data=%u)", _Address, PC, _Data);

Obviously changing the function name, and for the 64-bit write, the %u to a %llu (not tested!)

Then, enable memmap logging on the log window, and it'll show you the information about the operation so you can set a BP.

BLJRacer

Found a simpler way, just edit the first funcion of Breakpoints.cpp (TMemCheck::Action) to add the PC to the debug line.