[Bug symtab/25260] New: Handle decl before def more robustly

vries at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Mon Dec 9 06:18:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25260

            Bug ID: 25260
           Summary: Handle decl before def more robustly
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

This is a follow-up bug for PR24971 - "gdb ignores DW_AT_type on DIEs with a
specification".

A patch was committed for that PR that was deemed good enough for 9.1, but
perhaps we want a different solution for the longer term.

A tentative patch was posted here (
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/29 ):
...
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0a7a0334202..381bd45e805 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -21830,6 +21830,10 @@ new_symbol (struct die_info *die, struct type *type,
struct dwarf2_cu *cu,
              else if (attr2 && (DW_UNSND (attr2) != 0)
                       && dwarf2_attr (die, DW_AT_type, cu) != NULL)
                {
+                 if (die->tag == DW_TAG_variable && die_is_declaration (die,
cu)
+                     && TYPE_LENGTH (SYMBOL_TYPE (sym)) == 0)
+                     suppress_add = 1;
+
                  /* A variable with DW_AT_external is never static, but it
                     may be block-scoped.  */
                  list_to_add
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list