8 hours ago
Hi everyone,
While debugging a custom GBA Thumb audio mixer routine in mGBA 0.10.3 (macOS arm64 Qt6 build) using connected to the built-in GDB stub (), I noticed that setting a 32-bit hardware write watchpoint ( packet) inside IWRAM () causes a consistent +516 cycle drift on and triggers a pop every time execution resumes with .
Here is a screenshot of the ARM7TDMI register/watchpoint state alongside the and mGBA console output:
![[Image: 18d03c01ee3447.png]](https://files.media2url.com/free/18d03c01ee3447.png)
Direct image: https://files.media2url.com/free/18d03c01ee3447.png (uploaded via https://media2url.com/screenshot-to-url — full view: https://media2url.com/m/18d03c01ee3447)
Reproduction steps:
1. Configure Timer 0 (, prescaler 1) driving Direct Sound FIFO A () via DMA1 ().
2. Attach to and set a write watchpoint on the mixer channel position in IWRAM:
3. When the watchpoint traps inside () and we resume with , logs that VBlank IRQ is delayed by ~516 cycles and Timer 0 misses 4 overflow ticks before DMA1 refills .
Does the GDB stub pause sub-instruction DMA/Timer scheduling differently when trapping on an IWRAM data watchpoint () vs. an instruction breakpoint (), or is there a flag to freeze Timer 0 ticks while the stub is halted mid-scanline?
Thanks in advance!
While debugging a custom GBA Thumb audio mixer routine in mGBA 0.10.3 (macOS arm64 Qt6 build) using
Code:
arm-none-eabi-gdbCode:
localhost:2345Code:
Z2Code:
0x03004B20Code:
mTimingNextEventCode:
GBAAudioScheduleFifoDma: FIFO A empty on Timer 0 overflow!Code:
continueHere is a screenshot of the ARM7TDMI register/watchpoint state alongside the
Code:
arm-none-eabi-gdb![[Image: 18d03c01ee3447.png]](https://files.media2url.com/free/18d03c01ee3447.png)
Direct image: https://files.media2url.com/free/18d03c01ee3447.png (uploaded via https://media2url.com/screenshot-to-url — full view: https://media2url.com/m/18d03c01ee3447)
Reproduction steps:
1. Configure Timer 0 (
Code:
REG_TM0CNT_L = 0xFE80Code:
0x040000A0Code:
0xB6402. Attach
Code:
arm-none-eabi-gdbCode:
localhost:2345Code:
(gdb) target remote localhost:2345
(gdb) watch *(uint32_t*)0x03004b20
(gdb) cCode:
SoundMainRam_ThumbCode:
PC = 0x03001A44Code:
cCode:
_GBAVideoSoftwareRendererCode:
LY=161Code:
REG_FIFO_ADoes the GDB stub pause
Code:
mTimingCode:
_GBAMemoryWatchpointCode:
Z0Thanks in advance!

