Some machines of an arch may not have all the regs listed for it in RegInfo, and we get 'E15' as error while reading from such register, i.e. its not available.
For example MSA registers listed for MIPS are not present in all MIPS boards.
Differential D13859
[LLDB][LLGS Test] Check length of register, only when its available mohit.bhakkad on Oct 19 2015, 4:45 AM. Authored by
Details Some machines of an arch may not have all the regs listed for it in RegInfo, and we get 'E15' as error while reading from such register, i.e. its not available. For example MSA registers listed for MIPS are not present in all MIPS boards.
Diff Detail
Event TimelineComment Actions If the registers are not present, wouldn't it be better to *not* include them in qRegisterInfo response in the first place? Comment Actions We can't rely on any specific error codes since different GDB remote servers will hand back different errors for any packet. Do you have control over the MIPS debugserver? Is this just lldb-server? If so, we should have it not tell LLDB about a register it doesn't have. So I agree with labath that the GDB server should not tell us about this register in the first place. Comment Actions This patch makes server send an End of register(E45) response if a register present in reginfo is not available on actual machine. Comment Actions I think this should go in a little bit deeper, i.e., inside the NativeRegisterContextLinux_mips, or whatever is the right class for you. I think this is better for several reasons:
Comment Actions Is there a list of error codes and what they mean for the GDB remote protocol? debugserver returns random errors and doesn't abide by any specific error codes. Quote from some GDB remote protocol docs I found: The error response returned for some packets includes a two character error number. That number is not well defined. So we can't rely on specific responses unless you verify that the error is coming from a specific GDB server. In order to do this, we would need to add a qGDBServerInfo packet that could return a name, version info, etc: $qGDBServerInfo#00 $name:debugserver;version:123.2.3; The real fix is to fix the GDB server to not have it return this register if it is not available. Comment Actions Changes in this revision:
This will make llgs send E45 when reg_index is of some unavailable reg. |