public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Pedro Alves <pedro@palves.net>,
	Simon Marchi <simon.marchi@polymtl.ca>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: fix auxv caching
Date: Tue, 11 Oct 2022 13:42:24 -0700	[thread overview]
Message-ID: <4fca0778-8533-6f49-f86f-8bcf53b6d45b@FreeBSD.org> (raw)
In-Reply-To: <9379684a-ec46-6b17-c785-c8c308cb2924@palves.net>

On 10/11/22 1:34 PM, Pedro Alves wrote:
> 
> On 2022-10-11 9:31 p.m., Pedro Alves wrote:
>> On 2022-10-09 1:39 a.m., Simon Marchi via Gdb-patches wrote:
>>>
>>>> I think this approach is fine.  Having two variants of target_read_auxv is
>>>> a bit verbose, and I'm not sure it's abundantly clear to a new person when
>>>> to use one vs the other.  That said, these are used rarely, so probably
>>>> will intuit the right thing by looking at existing uses.  I agree with the
>>>> idea that the auxv reads during gdbarch_core_read_description should
>>>> effectively all be "raw" and uncached.
>>>
>>> The second one is perhaps not essential, call sites could call
>>>
>>>    target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL)
>>>
>>> themselves.  But I find it convenient to have this little wrapper.
>>>
>>> As to how to know which overload to call, perhaps that can be improved
>>> with better documentation and comments.  I'm not sure what to add
>>> though, the problem is so fresh in my mind that it's obvious to me.  So
>>> I'm open to suggestions.
>>
>> Maybe call the one that works with the cache, target_read_auxv_cached ?
>>
> 
> Or the other one target_read_auxv_raw, of course.

I think "_raw" would be better here as using the cached values should be the
default.

>> Two overloads that do different things is a sign that they shouldn't be
>> overloads, to me.
>>


-- 
John Baldwin

  reply	other threads:[~2022-10-11 20:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 14:45 [PATCH] Update auxv cache when there is no auxv cached data Luis Machado
2022-07-25  9:42 ` [PING][PATCH] " Luis Machado
2022-07-25 16:05 ` [PATCH] " John Baldwin
2022-07-25 18:03   ` Luis Machado
2022-07-25 19:13     ` John Baldwin
2022-08-02 15:05       ` Luis Machado
2022-08-02 16:05         ` John Baldwin
2022-08-05 15:46 ` [PATCH] Update auxv cache when inferior pid is 0 (no inferior) Luis Machado
2022-08-11  9:05   ` [PING][PATCH] " Luis Machado
2022-08-18 15:48   ` Luis Machado
2022-09-01  9:29   ` Luis Machado
2022-09-07  8:20   ` Luis Machado
2022-09-12 12:48   ` Luis Machado
2022-09-12 13:30   ` [PATCH] " Simon Marchi
2022-09-12 13:53     ` John Baldwin
2022-09-12 13:59       ` Luis Machado
2022-09-20 12:28 ` [PATCH] Invalidate auxv cache before creating a core target Luis Machado
2022-09-20 17:49   ` John Baldwin
2022-10-07 20:44   ` [PATCH] gdb: fix auxv caching Simon Marchi
2022-10-07 21:43     ` John Baldwin
2022-10-09  0:39       ` Simon Marchi
2022-10-10 18:32         ` John Baldwin
2022-10-11 17:52           ` Simon Marchi
2022-10-11 20:31         ` Pedro Alves
2022-10-11 20:34           ` Pedro Alves
2022-10-11 20:42             ` John Baldwin [this message]
2022-10-12  1:11               ` Simon Marchi
2022-10-10  9:33     ` Luis Machado
2022-10-11 17:53       ` 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=4fca0778-8533-6f49-f86f-8bcf53b6d45b@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@polymtl.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).