28.08.2015 22:21, Peter Maydell wrote:
I think what we need to do is have the translate-a64.c code be smarter, and actually generate the real code if we're not going to really hit the bp. Except that we don't really have all the info in the flags to know for sure about that. So we probably need to do something like generating a call to a helper which checks whether this bp should hit and doesn't throw the exception unless it has to, with the actual code for the insn following. I need to think about how this ought to work...
I think we should only generate a CPU breakpoint TCG exception when it is really going to become a CPU exception (or a GDB exception). It could be done by moving the logic of check_breakpoints() to a helper called from TB.
The watchpoint code has a chance of cpu_resume_from_signal doing the right thing, because we really did have the code to do the load/store. However I have a feeling this won't interact properly with the fact that ARM needs BP_STOP_BEFORE_ACCESS on its watchpoints (unlike x86, which is where I was looking at when I wrote the ARM wp handling code.) So we may well be broken there as well in the case where check_watchpoints() returns false.
As of watchpoints, I'm going to check that a bit later as well.