[PING][RFC][PATCH][PR remote/16896] Invalidate a register in cache when a remote target failed to write it.

Pedro Alves palves@redhat.com
Mon May 19 15:22:00 GMT 2014


On 05/19/2014 10:48 AM, Pierre Langlois wrote:

>> +      switch (store_register_using_P (regcache, reg))
>> +	{
>> +	case PACKET_OK:
>> +	  return;
>> +	case PACKET_ERROR:
>> +	  {
>> +	    regcache_invalidate (regcache, regnum);
>> +	    error (_("Could not write register \"%s\"; remote failure reply '%s'"),
>> +		   gdbarch_register_name (gdbarch, reg->regnum), rs->buf);
>> +	  }

Other targets can just as well throw errors.  I think it'd be better to
handle this generically in regcache_raw_read/write instead, around the
target_store_registers call.  Did you consider that?  Note we already
consider errors there, with a cleanup to restore inferior_ptid.

-- 
Pedro Alves



More information about the Gdb-patches mailing list