public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>,
	Tom Tromey <tromey@adacore.com>,
	Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH 2/4] Don't erase empty indices in DWARF reader
Date: Sat, 7 Jan 2023 15:24:09 +0400	[thread overview]
Message-ID: <Y7lWWZXxBVJzWRFH@adacore.com> (raw)
In-Reply-To: <87tu1rl3rh.fsf@tromey.com>

Hi Tom,

On Mon, Dec 19, 2022 at 10:09:06AM -0700, Tom Tromey via Gdb-patches wrote:
> >>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
> 
> >> The DWARF reader has some code to remove empty indices.  However, I
> >> think this code has been obsolete since some earlier changes to
> >> parallel_for_each.  This patch removes this code.
> 
> Andrew> Would NULL entries cause problems later in GDB?  Would it be worth
> Andrew> replacing this code with an assert that there are no NULL entries?  Or
> Andrew> would an attempt to create a NULL entry trigger an assert/error
> Andrew> elsewhere?
> 
> If it could happen, it would cause a crash when doing any kind of
> lookup, because cooked_index_vector iterates over the indices and calls
> methods on each one.
> 
> Andrew> Or maybe the cost of iterating over the list is what you want to remove
> Andrew> here?  In which case, could we guard an assert in '#ifdef DEVELOPER'?
> 
> I don't think there's any performance issue, as the size of the array is
> normally just the number of cores on the user machine.
> 
> It's more that this is a leftover and can't happen any more, due to the
> previous patch.  It seems to me that the contract of parallel_for_each
> should be that, if it returns results (i.e., not void), then each entry
> in the result must be the result of actually calling the callback --
> i.e., not some default.
> 
> That said, it's also fine to drop this patch.

If we believe the code is dead, let's drop it.

Maybe Andrew's assert suggestion could be helpful, although perhaps
a complaint might be a better compromise in this case, as I would say
a violation of this expectation would still mean a usable debugging
experience for the user, so let's not break things with an assert?

Thank you!
-- 
Joel

  reply	other threads:[~2023-01-07 11:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 19:07 [PATCH 0/4] Fix regression in new " Tom Tromey
2022-12-15 19:07 ` [PATCH 1/4] Avoid submitting empty tasks in parallel_for_each Tom Tromey
2023-01-07 11:19   ` Joel Brobecker
2023-01-09 16:20     ` Tom Tromey
2022-12-15 19:07 ` [PATCH 2/4] Don't erase empty indices in DWARF reader Tom Tromey
2022-12-19 14:51   ` Andrew Burgess
2022-12-19 17:09     ` Tom Tromey
2023-01-07 11:24       ` Joel Brobecker [this message]
2023-01-09 16:45         ` Tom Tromey
2023-01-09 18:18           ` Tom Tromey
2023-01-10 10:07             ` Andrew Burgess
2023-01-10 18:24               ` Tom Tromey
2022-12-15 19:07 ` [PATCH 3/4] Move hash_entry and eq_entry into cooked_index::do_finalize Tom Tromey
2023-01-07 11:26   ` Joel Brobecker
2022-12-15 19:07 ` [PATCH 4/4] Fix parameter-less template regression in new DWARF reader Tom Tromey
2023-01-07 11:37   ` Joel Brobecker
2023-01-07 11:45     ` Joel Brobecker

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=Y7lWWZXxBVJzWRFH@adacore.com \
    --to=brobecker@adacore.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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).