This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DW_AT_specification: long ago GDB change


Jason Merrill <jason@redhat.com> writes:

> On 15 Apr 2004 00:17:23 -0500, Jim Blandy <jimb@redhat.com> wrote:
> 
> > Back in 1999, you posted this patch:
> >
> >     http://sources.redhat.com/ml/gdb-patches/1999-q4/msg00325.html
> >
> > Do you know why you tested for the presence of DW_AT_specification, as
> > well as DW_AT_declaration?
> >
> > I can't think of a case where a die would be a declaration, but also
> > refer to a specification; since DW_AT_specification generally points
> > from definitions to previous declarations, I'd rather expect
> > specifications to point at declarations.  And even if a declaration
> > did have a specification, it would still be a declaration.
> 
> Yes.  IIRC, the issue is that dwarf_attr looks through the
> DW_AT_specification link, so it will find a DW_AT_declaration attribute in
> the definition.  Also looking for DW_AT_specification allows us to avoid
> that false positive for the test.

You're right.  Eeeew.

It's clearly wrong to follow DW_AT_specification and return the value
of the specification's DW_AT_declaration attribute.  For most
attributes, though, that's the right behavior.

Here are the attributes I see that we shouldn't search for in dies
referenced by DW_AT_specification, but which are reasonable to look
for in dies referred to by DW_AT_abstract_origin:

  - DW_AT_declaration
  - DW_AT_decl_column
  - DW_AT_decl_file
  - DW_AT_decl_line


Here are attributes which apply only to a specific die, and should
never be searched for on any referenced DIE:

  - DW_AT_sibling

I don't think that needs to be addressed; it's only relevant when
reading dies anyway.

I'll try to put together a patch for this.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]