This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]