From: Simon Marchi <simon.marchi@polymtl.ca>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 8/8] Construct readonly regcache without address space
Date: Tue, 31 Oct 2017 18:04:00 -0000 [thread overview]
Message-ID: <754eec4adad38c0df65b017db2900985@polymtl.ca> (raw)
In-Reply-To: <CAH=s-PMFXtwS-3J9et_onyEOCUL9P-AgO9V=pBt60neQn67g9g@mail.gmail.com>
On 2017-10-31 13:44, Yao Qi wrote:
> On Tue, Oct 31, 2017 at 2:35 PM, Simon Marchi
> <simon.marchi@ericsson.com> wrote:
>> On 2017-10-27 05:31 AM, Yao Qi wrote:
>>> The address space is useless to readonly regcache, so this patch
>>> removes
>>> the parameter to construct readonly regcache.
>>
>> Can you expand on why the aspace is useless for readonly regcaches?
>> The
>> comment of m_aspace says:
>>
>> /* The address space of this register cache (for registers where it
>> makes sense, like PC or SP). */
>>
>
> This comment was there because address_space was added for read-write
> regcache. Nowadays, address_space in regcache is used for various
> breakpoint/watchpoint checkings, and these regcache are not read-only
> regcache.
>
> Additionally, regcache itself doesn't use address_space at all, so
> various
> breakpoint/watchpoint checking code should get address_space from
> thread
> ptid rather than regcache.
>
>> Registers like PC or SP are present even in a readonly regcache, so I
>> would think that it makes sense to have the address space there as
>> well.
>> So, is it that it's really useless (as in it doesn't make sense to
>> have
>> it there) or that we just don't happen to use the address space right
>> now
>> with readonly regcaches?
>
> It doesn't make sense to have address_space in read-only regcache, at
> least. Since we don't have a type/class for read-only regcache, we
> still
> have to keep address_space in regcache. However, I don't see how
> address_space can be used by regcache, we can remove it from regcache
> completely, but that is a separate thing.
Ok thanks, that explanation helps to understand.
Simon
next prev parent reply other threads:[~2017-10-31 18:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 9:31 [PATCH 0/8] regcache misc cleanup and refactor Yao Qi
2017-10-27 9:31 ` [PATCH 3/8] New method regcache::assert_regnum Yao Qi
2017-10-27 9:31 ` [PATCH 1/8] Remove regcache_descr fields sizeof_raw_register_status and sizeof_cooked_register_status Yao Qi
2017-10-27 9:31 ` [PATCH 4/8] Remove regcache_descr::nr_raw_registers Yao Qi
2017-10-31 14:27 ` Simon Marchi
2017-11-02 15:20 ` Yao Qi
2017-10-27 9:32 ` [PATCH 5/8] s/get_regcache_aspace (regcache)/regcache->aspace ()/g Yao Qi
2017-10-27 9:32 ` [PATCH 8/8] Construct readonly regcache without address space Yao Qi
2017-10-31 14:35 ` Simon Marchi
[not found] ` <CAH=s-PMFXtwS-3J9et_onyEOCUL9P-AgO9V=pBt60neQn67g9g@mail.gmail.com>
2017-10-31 18:04 ` Simon Marchi [this message]
2017-10-27 9:32 ` [PATCH 6/8] const-fy regcache::m_aspace Yao Qi
2017-10-31 14:19 ` Simon Marchi
2017-11-01 9:43 ` Yao Qi
2017-11-01 14:00 ` Simon Marchi
2017-11-01 14:35 ` Yao Qi
2017-10-27 9:32 ` [PATCH 7/8] const-fy regcache::m_readonly_p Yao Qi
2017-10-27 9:32 ` [PATCH 2/8] Remove code wrapped by "#if 0" Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=754eec4adad38c0df65b017db2900985@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
--cc=simon.marchi@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox