Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware watchpoints don't fire since 0.8.0 #1947

Closed
exelotl opened this issue Nov 23, 2020 · 1 comment
Closed

Hardware watchpoints don't fire since 0.8.0 #1947

exelotl opened this issue Nov 23, 2020 · 1 comment

Comments

@exelotl
Copy link

exelotl commented Nov 23, 2020

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.
@endrift
Copy link
Member

endrift commented Nov 24, 2020

Hm, gdb. I don't tend to use that as often so it's broken from time to time. I think I switched which type of watchpoint is set by default in 0.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants