public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Tom Tromey <tom@tromey.com>,
	Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/stack.c: avoid stale pointers when printing frame arguments
Date: Mon, 27 Jun 2022 15:52:17 -0300	[thread overview]
Message-ID: <59a2b50b-0c7d-b272-9b58-a618e6e292ee@redhat.com> (raw)
In-Reply-To: <3ff0c39a-ed56-2f58-d81a-9af7b9252bae@redhat.com>


On 6/20/22 10:12, Bruno Larsen wrote:
> 
> 
> On 6/15/22 12:43, Tom Tromey wrote:
>>>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
...
>>
>> Bruno> +  /* print_frame can invalidate frame, so cache the frame_id to rebuild
>> Bruno> +     the whole stack later, if needed.  */
>> Bruno> +  struct frame_id frame_id = get_frame_id (frame);
>>
>> This repeated code makes me wonder if perhaps the print_frame_info API
>> ought to be changed instead.
> 
> print_frame_info could return an updated pointer to the frame being printed, or receive a
> frame_info** and update it in-place.  However, We'll still need to check for a null pointer
> after calling, since we won't want print_frame_info to error out if a frame no longer
> exists.  We might not care when printing.
> 
> Does any of these options sound like a better option? Or would we always want to error out
> if the frame disappears from under us?
> 

I've spent a couple of days checking this, but to avoid repeating the code, there is just so
much to be re-written that trying to fix the issues you had with making frame_info* smart pointers
seems to be a better use of my time.

Is this a blocking issue, or can the patch be merged with some repeated code and we fix this later?


Cheers!
Bruno Larsen
> 
> Cheers!
> Bruno Larsen
>>
>> Tom
>>


      reply	other threads:[~2022-06-27 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 19:10 Bruno Larsen
2022-05-18 11:24 ` [PING] " Bruno Larsen
2022-05-24 11:25   ` [PINGv2] " Bruno Larsen
2022-05-30 11:16     ` [PINGv3] " Bruno Larsen
2022-06-06 12:46       ` [PINGv4] " Bruno Larsen
2022-06-13 20:02         ` [PINGv5] " Bruno Larsen
2022-06-15 15:43 ` Tom Tromey
2022-06-20 13:12   ` Bruno Larsen
2022-06-27 18:52     ` Bruno Larsen [this message]

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=59a2b50b-0c7d-b272-9b58-a618e6e292ee@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).