public inbox for
 help / color / mirror / Atom feed
From: Simon Marchi <>
To: Tom Tromey <>,
	Simon Marchi via Gdb-patches <>
Cc: Andrew Burgess <>,
	Simon Marchi <>
Subject: Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
Date: Tue, 31 Jan 2023 10:35:28 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 1/31/23 09:19, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <> writes:
> Simon> See the patch below for a quick prototype.
> Simon> quick_symbol_functions::read_partial_symbols now returns a bool, and if
> Simon> it returns false (failure), objfile::require_partial_symbols removes
> Simon> that quick symbol instance from the qf list.
> I'm working to get rid of this lazy symbol stuff.  So I'd rather not add
> another meaning to it.  You can see the WIP on t/bg-dwarf-reading, but
> the basic idea is that instead of delaying the reading of DWARF, start
> the reading early and just delay the completion of it.  I haven't sent
> this yet because it currently crashes, I think it will benefit from
> being rebased on the write-index-in-background patch.
> All the other methods in cooked_index_functions already do:
>   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
>   if (per_objfile->per_bfd->index_table == nullptr)
>     return;

Ah ok, I had not seen that.  Then it makes sense to follow that paradigm
in dump too.

> So maybe this would be an ok choice for dump.
> As an aside the code is doing:
>   if (per_bfd->index_table == nullptr)
>     return nullptr;
>   cooked_index_vector *table
>     = (gdb::checked_static_cast<cooked_index_vector *>
>        (per_bfd->index_table.get ()));
> It seems to me that it would be fine if checked_static_cast passed
> through null in this case -- that is, do not assert when the result is
> null if the parameter is also null.

I think that would make sense.  Both static_cast and dynamic_cast return
nullptr if passed nullptr, so checked_static_cast should too.

However, in my case it would have crashed anyway on the following line
dereferencing the table variable.


      reply	other threads:[~2023-01-31 15:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 16:03 Simon Marchi
2023-01-30 16:08 ` Simon Marchi
2023-01-30 19:07 ` Tom Tromey
2023-01-30 20:08   ` Simon Marchi
2023-01-30 21:35 ` Andrew Burgess
2023-01-31  3:06   ` Simon Marchi
2023-01-31  9:21     ` Andrew Burgess
2023-01-31 15:49       ` Simon Marchi
2023-01-31 17:27         ` Tom Tromey
2023-01-31 14:19     ` Tom Tromey
2023-01-31 15:35       ` Simon Marchi [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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).