Triggering an EL0 watchpoint generates SIGTRAP after this patch.
I'm not sure here and I can't figure out the abstractions in Linux code but on Linux I'm getting a SIGTRAP with si_addr pointing to the watched memory rather than the instruction, and LLDB uses that to identify which watchpoint was hit. Do you have any suggestion if I can determine that any other way?
Hmm. Returning the watched address in si_addr does seem more useful. I don't think there is any other simple way to determine which watchpoint triggered the exception, so we can probably switch over to this.
My only reservation is that FreeBSD/amd64 does not appear to behave this way, and it returns the trapping instruction address in si_addr.