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]

DW_AT_specification: long ago GDB change


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.

Looking at the only code in gcc/dwarf2out.c that adds
DW_AT_specification attributes to dies supports this:

    /* Add an AT_specification attribute to a DIE, and also make the back
       pointer from the specification to the definition.  */

    static inline void
    add_AT_specification (dw_die_ref die, dw_die_ref targ_die)
    {
      add_AT_die_ref (die, DW_AT_specification, targ_die);
      if (targ_die->die_definition)
        abort ();
      targ_die->die_definition = die;
    }

I guess if there were several declarations chained together,
eventually pointing to a definition, then the intermediate dies could
have both attributes.  Does this happen?


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