In a Cortex-A7 is there a register that shows which breakpoint or watchpoint has triggered a debug event?
Or what's the usual way to find out?
I understand that DFSR FS tells if the DABT took place due to debug event (IFSR for PABT) and MOE in DBGDSCR can tell if it was
a synchronous watchpoint debug event (my chip doesn't have asynchronous ones) or sync/async breakpoint debug event
How can I tell which breakpoint/watchpoint was causing the event? Just by reading the address from DFAR/IFAR and comparing with
the DBGBVR/DBGWVR registers?
It looks like the only way is to compare the DFAR to DBGWVR and DBGWCR BAS-field.
That is: if DFAR & (~7) == DBGWVR and ((1 << (DFAR & 7)) & DBGWCR.BAS) != 0
that watchpoint must have been triggered.
(Or in some cases the '7' could be '3'.)