In remote_prepare_to_store() we have the following:
/* Make sure the entire registers array is valid. */
switch (remote_protocol_P.support)
{
case PACKET_DISABLE:
case PACKET_SUPPORT_UNKNOWN:
/* NOTE: This isn't rs->sizeof_g_packet because here, we are
forcing the register cache to read its and not the target
registers. */
deprecated_read_register_bytes (0, (char *) NULL,
DEPRECATED_REGISTER_BYTES); /* OK */
Recently, Andrew has removed the need to set REGISTER_BYTES and turned
it into DEPRECATED_REGISTER_BYTES. On targets that don't set it,
DEPRECATED_REGISTER_BYTES will be zero, which reduces this
deprecated_read_register_bytes call to a no-op. As a result GDB tries
to write garbage into the registers on the remote target, and sooner
or later things blow up in your face.
A possible solution would be to introduce a new function that
completely fills the register cache upon request. Comments?