From: Joel Brobecker <brobecker@adacore.com>
To: Keith Seitz <keiths@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,
Sergio Durigan Junior <sergiodj@redhat.com>,
gdb-patches@sourceware.org, Pedro Alves <palves@redhat.com>
Subject: Re: possible fix for PR symtab/23010
Date: Wed, 30 May 2018 22:26:00 -0000 [thread overview]
Message-ID: <20180530205548.nump2kfxfsxuwfhc@adacore.com> (raw)
In-Reply-To: <2c888612-11e8-b376-5797-b40fada46867@redhat.com>
> [WARNING: Very long explanation enclosed. Skip to end if interested in
> conclusions.]
This is extremely useful in understanding the source of the problem,
and therefore the solution. A bit thank you for writing it up.
> And that is the cause of these problems. The call to
> prepare_one_comp_unit needs to be the *first* thing that is done when
> reading a CU so that the CU's language can be recorded (and inherited
> by any referenced partial_units).
>
> So, alas, this is the near trivial patch to fix this dictionary/symbol
> assertion in insert_symbol_hashed:
I agree with Tom; very nice investigative work, and the near trivial
patch feels like gravy.
>
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 49ce83ff20..0145c83b30 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -11470,6 +11470,8 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
> struct die_info *child_die;
> CORE_ADDR baseaddr;
>
> + prepare_one_comp_unit (cu, die, cu->language);
> +
> baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
>
> get_scope_pc_bounds (die, &lowpc, &highpc, cu);
> @@ -11482,8 +11484,6 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
>
> file_and_directory fnd = find_file_and_directory (die, cu);
>
> - prepare_one_comp_unit (cu, die, cu->language);
> -
> /* The XLCL doesn't generate DW_LANG_OpenCL because this attribute is not
> standardised yet. As a workaround for the language detection we fall
> back to the DW_AT_producer string. */
>
I looked at the patch, and in particular, checked to see if there
is anything we were doing ahead of the call to prepare_one_comp_unit
that prepare_one_comp_unit would also need. But this function
does very little, basically reading the DW_AT_language and
the DW_AT_producer attributes. So I don't see how this could have
some negative side-effect, or any hints of why it might have been
placed slight later in read_file_scope's body.
A testcase in this particular case, where the order in which we do
things is important, would be very useful in avoiding a regression.
However, considering how specific the conditions need to be in order
to trigger the bug, and considering the current timing, I (personally)
think that we should not let best be the enemy of good, and allow
this patch in if Keith fails to create a testcase after a reasonable
amount of effort.
--
Joel
next prev parent reply other threads:[~2018-05-30 20:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 19:06 Tom Tromey
2018-04-17 19:17 ` Keith Seitz
2018-04-19 20:39 ` Tom Tromey
2018-04-30 22:44 ` Joel Brobecker
2018-05-07 17:13 ` Joel Brobecker
2018-05-14 19:43 ` Joel Brobecker
2018-05-18 1:22 ` Sergio Durigan Junior
2018-05-24 4:08 ` Tom Tromey
2018-05-24 10:50 ` Sergio Durigan Junior
2018-05-24 10:50 ` Tom Tromey
2018-05-24 15:54 ` Keith Seitz
2018-05-26 0:24 ` Keith Seitz
2018-05-27 15:20 ` Tom Tromey
2018-05-30 22:26 ` Joel Brobecker [this message]
2018-05-17 17:16 ` 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=20180530205548.nump2kfxfsxuwfhc@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--cc=palves@redhat.com \
--cc=sergiodj@redhat.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