public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <Lancelot.Six@amd.com>
To: Tom Tromey <tom@tromey.com>,
	Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
Cc: lsix@lancelotsix.com
Subject: Re: [PATCH v2 1/2] gdb: Require psymtab before calling quick_functions in objfile
Date: Sat, 21 May 2022 00:07:06 +0100	[thread overview]
Message-ID: <0db126be-7d03-d8ec-c825-a8dbd3d4ce72@amd.com> (raw)
In-Reply-To: <87k0agb3tn.fsf@tromey.com>



On 20/05/2022 16:51, Tom Tromey wrote:
> [CAUTION: External Email]
> 
>>>>>> "Lancelot" == Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Lancelot> we see something like:
> Lancelot> This patch proposes to wrap the access of the `qf` field with an accessor
> Lancelot> which ensures that partial symbols have been read before iterating:
> Lancelot> qf_require_partial_symbols.  All calls to quick functions are updated
> Lancelot> except:
> 
> Thank you for the patch.
> I have one small nit.
> 
> Lancelot> +  /* Ensure that partial symbols have been read and return the "quick" (aka
> Lancelot> +     partial) symbol functions for this symbol reader.  */
> Lancelot> +
> Lancelot> +  const std::forward_list<quick_symbol_functions_up> &
> Lancelot> +    qf_require_partial_symbols ()
> Lancelot> +      {
> Lancelot> +     this->require_partial_symbols (true);
> Lancelot> +     return qf;
> Lancelot> +      }
> Lancelot> +
> 
> It seems like this could be private instead of public.
> 
> It's ok with that change, you don't need to re-send it.
> 
> Tom

Hi,

Thanks for the review.

I have changed the declaration locally as follows (I did some back and 
forth on whether it should stay grouped with the other methods of 
ojbfile bracketed between a pritave:/public: pair or if it should go in 
a private section at the end of the struct — I finally opted for former).

I'll keep this and push it with the revised version of patch #2 once 
approved.

Best,
Lancelot.

---

diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index cb7a1357cfe..9da12ff12e0 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -612,6 +612,19 @@ struct objfile
      this->section_offsets[idx] = offset;
    }

+private:
+
+  /* Ensure that partial symbols have been read and return the "quick" (aka
+     partial) symbol functions for this symbol reader.  */
+  const std::forward_list<quick_symbol_functions_up> &
+  qf_require_partial_symbols ()
+  {
+    this->require_partial_symbols (true);
+    return qf;
+  }
+
+public:
+
    /* The object file's original name as specified by the user,
       made absolute, and tilde-expanded.  However, it is not canonicalized
       (i.e., it has not been passed through gdb_realpath).

  reply	other threads:[~2022-05-20 23:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 18:45 [PATCH v2 0/2] Fix regression with lazy-loading of partial symbols Lancelot SIX
2022-05-19 18:45 ` [PATCH v2 1/2] gdb: Require psymtab before calling quick_functions in objfile Lancelot SIX
2022-05-20 15:51   ` Tom Tromey
2022-05-20 23:07     ` Lancelot SIX [this message]
2022-05-21  1:07       ` Tom Tromey
2022-05-19 18:45 ` [PATCH v2 2/2] gdb: Simplify psymbol_functions::require_partial_symbols Lancelot SIX
2022-05-20 15:51   ` Tom Tromey
2022-05-20 16:07   ` Simon Marchi
2022-05-20 22:55     ` [PATCH v3 2/2] gdb: Change psymbol_functions::require_partial_symbols to partial_symbols Lancelot SIX
2022-05-26 17:57       ` Tom Tromey
2022-05-26 20:42         ` Lancelot SIX

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=0db126be-7d03-d8ec-c825-a8dbd3d4ce72@amd.com \
    --to=lancelot.six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --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).