This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] Regcache: Subclass ptid functionality to target_regcache
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 23 Aug 2017 11:33:02 +0100
- Subject: Re: [PATCH 1/7] Regcache: Subclass ptid functionality to target_regcache
- Authentication-results: sourceware.org; auth=none
- References: <6AAAA989-5B31-4E54-963C-57F2B7452BD7@arm.com>
Alan Hayward <Alan.Hayward@arm.com> writes:
> All ptid related functions are moved to target_regcache.
>
What is the rationale of this change? The regcache is per-thread, even
it is disconnected from target.
> A regcache retains the ptid () method, which always returns -1.
ptid_t (-1) is minus_one_ptid, which has a special meaning.
> This ensures users can always test if a regcache is attached to a
> target, without needing to know if it is a target_regcache.
When do we need such test ("if a regcache is attached to a target")?
--
Yao (齐尧)