Some CPU architectures will give lldb a watchpoint exception before the instruction has executed (it is rolled back when the address matches), or after the instruction has executed. Currently, lldb learns which type of CPU this is from the gdb remote serial protocol stub though a key in the lldb-extension qHostInfo packet. This is fixed for most architectures, and lldb needs to interop with non-debugserver/non-lldb-server stubs, so moving this into lldb simplifies a lot. This patch still allows the remote stub to override the behavior if it needs to.
There's another lldb extended gdb RSP packet to retrieve the number of watchpoints that this target supports. This needs to be calculated on the target system to be correct, so the stub is the right place to retrieve this knowledge. But lldb needs to interoperate with remote stubs that do not implement this extended packet; we can optionally print the number to the user, but we should not prevent watchpoints from attempting to be set based on this number.
This patch changes lldb to expect these pieces of information -- whether the exceptions are received before/after, and the number of watchpoints -- to not be available from the remote stub, and behave correctly.
The bug driving this was when connected to a gdb RSP stub that did not implement one of these extended packets, and debugging on a target where watchpoint exceptions are received before the instruction executes. lldb would try to fetch whether this machine is a before/after machine, and also fetch the number of watchpoints. The latter packet was not implemented, and Process::GetWatchpointSupportInfo would return error and not provide whether watchpoint exceptions are before/after.
This is a bit muddled.
I guess your point is that number of watchpoints the user can set may be less than the number that the hardware supports. And that this method returns the latter not the former. So perhaps: