public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom de Vries <tdevries@suse.de>,  Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] [gdb/symtab] Find main language without symtab expansion
Date: Fri, 04 Aug 2023 11:17:02 -0600	[thread overview]
Message-ID: <87pm42afsh.fsf@tromey.com> (raw)
In-Reply-To: <20230804112243.11537-1-tdevries@suse.de> (Tom de Vries via Gdb-patches's message of "Fri, 4 Aug 2023 13:22:43 +0200")

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> Reimplement the feature by adding
Tom> cooked_index_functions::lookup_global_symbol_language.

Thanks for the patch.

Tom> +    /* Expansion of large CUs can be slow.  By returning the language of main
Tom> +       here for C and C++, we avoid CU expansion during set_initial_language.
Tom> +       But by doing a symbol lookup in the cooked index, we are forced to wait
Tom> +       for finalization to complete.  See PR symtab/30174 for ideas how to
Tom> +       bypass that as well.  */
Tom> +    cooked_index *table = per_bfd->index_table->index_for_writing ();

I think it's more normal to use:

  cooked_index *table
    = (gdb::checked_static_cast<cooked_index *>
       (per_bfd->index_table.get ()));

in the body of cooked_index_functions.

Tom> +    for (const cooked_index_entry *entry : table->find (name, false))

I think this is probably racy, if the intent is not to wait for
finalization, because cooked_index_shard::find uses the canonical name.

Maybe we need to resurrect the approach of looking for "main" in C/C++
CUs.  I don't really remember all the state of this right now, there's
been a lot of flux.  I did also reimplement some of this on my
background DWARF reading branch, but I think that's kind of invasive.

Tom

  reply	other threads:[~2023-08-04 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 11:22 Tom de Vries
2023-08-04 17:17 ` Tom Tromey [this message]
2023-08-04 20:52   ` Tom de Vries
2023-08-05 13:19     ` Tom Tromey

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=87pm42afsh.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).