This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] dwarf2read.c: Rewrite signatured type handling
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 16 Apr 2013 13:50:53 -0700
- Subject: Re: [patch] dwarf2read.c: Rewrite signatured type handling
- References: <yjt2haj7s5bu dot fsf at ruffy2 dot mtv dot corp dot google dot com> <87y5cia3qg dot fsf at fleche dot redhat dot com>
On Tue, Apr 16, 2013 at 8:34 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> This patch simplifies and improves signature type handling a bit.
> Doug> For one, it no longer calls error on certain kinds of bad debug info,
> Doug> instead it just creates a TYPE_CODE_ERROR type.
> Doug> I like calling error() early on - errors are detected sooner.
> Doug> But this code has been in use for a fair while,
> Doug> and in general we want gdb to at least limp along in the presence
> Doug> of bad debug info.
>
> Doug> Plus it paves the way for a subsequent optimization for Fission.
>
> Doug> Regression tested on amd64-linux with/without Fission.
>
> Doug> I will check this in in a few days if there are no objections.
>
> No objections -- one nit, one question.
>
> Doug> +
> Doug> +static struct die_info *
> Doug> +follow_die_sig (struct die_info *src_die, struct attribute *attr,
> Doug> + struct dwarf2_cu **ref_cu)
> Doug> +{
>
> This function needs a comment.
Righto.
> Doug> + sig_type = lookup_signatured_type (signature);
> Doug> + /* sig_type will be NULL if the signatured type is missing from
> Doug> + the debug info. */
> Doug> + if (sig_type == NULL)
> Doug> + {
> Doug> + error (_("Dwarf Error: Cannot find signatured DIE %s referenced"
> Doug> + " from DIE at 0x%x [in module %s]"),
> Doug> + hex_string (signature), src_die->offset.sect_off,
> Doug> + (*ref_cu)->objfile->name);
>
> I'm curious why there are errors calls in this function still.
Fixing this requires changes beyond the scope of this patch.
This function returns a struct die_info *, not a struct type *.
See this function's cousin: follow_die_ref.