This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][RFC][PATCH][PR remote/16896] Invalidate a register in cache when a remote target failed to write it.
- From: Pedro Alves <palves at redhat dot com>
- To: Pierre Langlois <pierre dot langlois at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Mon, 19 May 2014 16:22:36 +0100
- Subject: Re: [PING][RFC][PATCH][PR remote/16896] Invalidate a register in cache when a remote target failed to write it.
- Authentication-results: sourceware.org; auth=none
- References: <536BC1A3 dot 7010705 at embecosm dot com> <5379D371 dot 1090005 at embecosm dot com>
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