public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Bruno Larsen <blarsen@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,
	 Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb/stack.c: avoid stale pointers when printing frame arguments
Date: Tue, 05 Apr 2022 07:58:20 -0600	[thread overview]
Message-ID: <8735irhbsz.fsf@tromey.com> (raw)
In-Reply-To: <038cc489-18f0-47ee-443c-cb0c651d0fd5@redhat.com> (Bruno Larsen's message of "Mon, 4 Apr 2022 18:42:36 -0300")

>>>>> "Bruno" == Bruno Larsen <blarsen@redhat.com> writes:

Bruno> This sounds like a good idea. I am just not sure if you are
Bruno> suggesting it as a fix instead of what I proposed, or to
Bruno> implement later, can you clarify it please?

You don't have to do it.

Bruno> +  if (frame_cache_count < get_frame_cache_generation ())
Bruno> +    reinit_frame_cache ();

>> I don't think I understand this bit.  If the generation changes,
>> hasn't
>> the cache already been cleared?

Bruno> If the cache has been cleared by printing a frame, it was done because
Bruno> a function was called manually (probably). If it did happen, the cache
Bruno> may have been invalidated and it is safer to rebuild
Bruno> everything. print_frame_cache by itself doesn't reinitialize the frame
Bruno> cache.

My understanding is that the generation only changes when
reinit_frame_cache is called.  So if that's the case, why does it need
to be reinitalized a second time?  That's the part I don't understand.

thanks,
Tom

  reply	other threads:[~2022-04-05 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 17:57 Bruno Larsen
2022-04-04 19:06 ` Tom Tromey
2022-04-04 21:42   ` Bruno Larsen
2022-04-05 13:58     ` Tom Tromey [this message]
2022-04-05 14:47       ` Bruno Larsen
2022-04-05 16:39         ` Andrew Burgess
2022-04-05 16:54 ` Andrew Burgess

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=8735irhbsz.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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).