Add a symbol's value to the computed frag offset, rather than overwriting it.
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index 83679fe57785c9375d50a03c3f7d914699105488..67898e431593dc95c6a24ef31fc847e3b7d3451e 100644 (file)
@@ -621,6 +621,8 @@ static void set_cu_language PARAMS ((unsigned int));
 static struct attribute *dwarf_attr PARAMS ((struct die_info *,
                                             unsigned int));
 
+static int die_is_declaration (struct die_info *);
+
 static void dwarf_decode_lines PARAMS ((unsigned int, char *, bfd *));
 
 static void dwarf2_start_subfile PARAMS ((char *, char *));
@@ -2202,7 +2204,7 @@ read_structure_scope (die, objfile)
      type within the structure itself. */
   die->type = type;
 
-  if (die->has_children)
+  if (die->has_children && ! die_is_declaration (die))
     {
       struct field_info fi;
       struct die_info *child_die;
@@ -3700,6 +3702,13 @@ dwarf_attr (die, name)
   return NULL;
 }
 
+static int
+die_is_declaration (struct die_info *die)
+{
+  return (dwarf_attr (die, DW_AT_declaration)
+         && ! dwarf_attr (die, DW_AT_specification));
+}
+
 /* Decode the line number information for the compilation unit whose
    line number info is at OFFSET in the .debug_line section.
    The compilation directory of the file is passed in COMP_DIR.  */
@@ -5749,6 +5758,14 @@ decode_locdesc (blk, objfile)
          i += bytes_read;
          break;
 
+       case DW_OP_bregx:
+         offreg = 1;
+         basereg = read_unsigned_leb128 (NULL, (data + i), &bytes_read);
+         i += bytes_read;
+         stack[++stacki] = read_signed_leb128 (NULL, (data + i), &bytes_read);
+         i += bytes_read;
+         break;
+
        case DW_OP_fbreg:
          stack[++stacki] = read_signed_leb128 (NULL, (data + i), &bytes_read);
          i += bytes_read;
This page took 0.025076 seconds and 4 git commands to generate.