From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Morichetti@sourceware.org, Laurent <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH 1/4] gdb: rename regcache::current_regcache to regcache::regcaches
Date: Thu, 23 Jul 2020 21:01:58 +0100 [thread overview]
Message-ID: <0cf1560d-0e39-eb5b-40ea-fa1a26117a9d@palves.net> (raw)
In-Reply-To: <20200720204101.2849535-2-simon.marchi@efficios.com>
Hi!
On 7/20/20 9:40 PM, Simon Marchi via Gdb-patches wrote:
> The name `current_regcache` for the list of currently-existing regcaches
> sounds wrong. The name is singular, but it holds multiple regcaches, so
> it could at least be `current_regcaches`.
>
> But in other places in GDB, "current" usually means "the object we are
> working with right now". For example, we swap the "current thread" when
> we want to operate on a given thread. This is not the case here, this
> variable just holds all regcaches that exist at any given time, not "the
> regcache we are working with right now".
It used to hold a single regcache, and then it was made a list:
https://sourceware.org/pipermail/gdb-patches/2009-June/065986.html
... but the name wasn't changed.
>
> So, I think calling it `regcaches` is better. I also considered
> `regcache_list`, but a subsequent patch will make it a map and not a
> list, so it would sound wrong again. `regcaches` sounds right for any
> collection of regcache, whatever the type.
>
> Rename a few other things that were related to this `current_regcache`
> field. Note that there is a `get_current_regcache` function, which
> returns the regcache of the current thread. That one is fine, because
> it returns the regcache for the current thread.
>
> gdb/ChangeLog:
>
> * regcache.h (class regcache) <current_regcache>: Rename to...
> <regcaches>: ... this. Move doc here.
> * regcache.c (regcache::current_regcache) Rename to...
> (regcache::regcaches): ... this. Move doc to header.
> (get_thread_arch_aspace_regcache): Update.
> (regcache::regcache_thread_ptid_changed): Update.
> (registers_changed_ptid): Update.
> (class regcache_access) <current_regcache_size>: Rename to...
> <regcaches_size>: ... this.
> (current_regcache_test): Rename to...
> (regcaches_test): ... this.
> (_initialize_regcache): Update.
OK.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2020-07-23 20:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 20:40 [PATCH 0/4] Regcache fix and optimization Simon Marchi
2020-07-20 20:40 ` [PATCH 1/4] gdb: rename regcache::current_regcache to regcache::regcaches Simon Marchi
2020-07-23 20:01 ` Pedro Alves [this message]
2020-07-20 20:40 ` [PATCH 2/4] gdb: move regcache::regcaches to regcache.c Simon Marchi
2020-07-23 20:03 ` Pedro Alves
2020-07-20 20:41 ` [PATCH 3/4] gdb: pass target to thread_ptid_changed observable Simon Marchi
2020-07-23 20:42 ` Pedro Alves
2020-07-30 15:27 ` Simon Marchi
2020-08-05 14:50 ` Pedro Alves
2020-08-05 19:08 ` Simon Marchi
2020-08-05 22:29 ` Pedro Alves
2020-07-20 20:41 ` [PATCH 4/4] gdb: change regcache list to be a map Simon Marchi
2020-07-24 1:53 ` Pedro Alves
2020-07-24 16:59 ` John Baldwin
2020-07-30 16:26 ` Simon Marchi
2020-07-30 16:58 ` Simon Marchi
2020-07-30 17:03 ` Simon Marchi
2020-08-05 18:02 ` Pedro Alves
2020-08-05 20:25 ` Simon Marchi
2020-07-30 17:07 ` Simon Marchi
2020-07-30 18:17 ` Simon Marchi
2020-08-05 18:14 ` Pedro Alves
2020-08-10 19:15 ` Tom Tromey
2020-08-10 19:25 ` Simon Marchi
2020-08-12 12:52 ` Tom Tromey
2020-08-12 15:17 ` Tom Tromey
2020-08-06 20:27 ` [PATCH 0/4] Regcache fix and optimization Simon Marchi
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=0cf1560d-0e39-eb5b-40ea-fa1a26117a9d@palves.net \
--to=pedro@palves.net \
--cc=Laurent.Morichetti@amd.com \
--cc=Morichetti@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.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