This patch takes a few corrective measures to make sure we display meaningful reason against a watchpoint creation failure.
This is particularly important for the targets where we get to know dynamically about the availability of hardware watchpoint resources.
We are trying to check whether we have sufficient hardware watchpoint slots available before we go ahead and create a new watchpoint.
This logic isn't necessarily correct. If we have the ability to watch N bytes at a time with a single hardware watchpoint, we might have 1 hardware watchpoint that is able to watch multiple things. So for code like:
then we watch "buffer[1]" and "buffer[7]", we could actually have 2 watchpoints but only use 1 hardware watchpoint. We really should be allowing each process plug-in to try and set the watchpoint and return the correct error instead of generically trying to catch _anything_ at the target level. So it seems like this code should be removed and moved into RegisterContext and allow each register context plug-in to respond correctly as only the it will know what can be done.