Skip to content

Hardware watchpoints don't fire since 0.8.0 #1947

Closed
@exelotl

Description

@exelotl

Hey, sorry for not reporting this earlier - in recent months I've found that hardware watchpoints don't function correctly (tested both on Windows and Linux). They previously used to work on 0.7.3, and must have broken some time between then and the release of 0.8.0.

Here's a minimal example using libtonc:

Example code

(can use this template to compile if you need)

#include <tonc.h>

int my_num = 0;

int main() {
	irq_init(NULL);
	irq_enable(II_VBLANK);
	while (1) {
		VBlankIntrWait();
		my_num = qran();   // Assign random value
	}
}

Debug scripts

Windows:

start "" /B "C:\Users\exelotl\path\to\mGBA.exe" -g mgba-watchpoints.elf
pause
C:\msys64\opt\devkitpro\devkitARM\bin\arm-none-eabi-gdb.exe mgba-watchpoints.elf -ex "target remote localhost:2345"

Linux:

mgba-qt -g mgba-watchpoints.elf &
sleep 2
/opt/devkitpro/devkitARM/bin/arm-none-eabi-gdb mgba-watchpoints.elf -ex "target remote localhost:2345"

GDB session - mGBA 0.7.3

✔️ behaves as expected

Reading symbols from mgba-watchpoints.elf...done.
Remote debugging using localhost:2345
0x08000190 in ClrLoop ()
(gdb) watch my_num
Hardware watchpoint 1: my_num
(gdb) c
Continuing.

Hardware watchpoint 1: my_num

Old value = 0
New value = 16537
main () at C:/msys64/home/exelotl/gba-tests/mgba-watchpoints/source/main.c:11
11                      VBlankIntrWait();
(gdb)

GDB session - mGBA 0.8.0 to 0.8.4

❌ watchpoint never fires

Reading symbols from mgba-watchpoints.elf...done.
Remote debugging using localhost:2345
0x08000190 in ClrLoop ()
(gdb) watch my_num
Hardware watchpoint 1: my_num
(gdb) c
Continuing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions