This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC PATCH v5 3/9] Add scoped_restore_regcache_ptid
- From: Simon Marchi <simark at simark dot ca>
- To: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>, gdb-patches at sourceware dot org
- Cc: Omair Javaid <omair dot javaid at linaro dot org>, Yao Qi <qiyaoltc at gmail dot com>, arnez at linux dot vnet dot ibm dot com
- Date: Sat, 17 Mar 2018 14:08:11 -0400
- Subject: Re: [RFC PATCH v5 3/9] Add scoped_restore_regcache_ptid
- References: <20180312153115.47321-1-prudo@linux.vnet.ibm.com> <20180312153115.47321-4-prudo@linux.vnet.ibm.com>
On 2018-03-12 11:31 AM, Philipp Rudo wrote:
> When a target and its target beneath use different ptids to identify a
> thread the regcaches ptid has to be set/restored when calls are passed down
> to the target beneath to e.g. fetch_registers. Add a scoped_restore to
> simplify this.
Though I don't understand yet why this is needed (I'll find out when reading
the following patches), the implementation looks ok.
I don't think this is an issue (at least for now), but there is this observer
"thread_ptid_changed" that indicates when a thread changes ptid. If this
observer is triggered while we have temporarily changed a regcache's ptid,
I guess we could miss updating a regcache's ptid, as
scoped_restore_regcache_ptid will reset it to the old ptid. It's probably
not a problem but I think it's good to be aware of this.
Simon