gdb/
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index c79f2bedd6d781405e99d7f01b0e4a75ddbd0862..fc6a4d50d2096d185a3b66c5eedd44377e2cd8e0 100644 (file)
@@ -4723,50 +4723,6 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
     }
 }
 
-/* Check for GCC >= 4.x.  Return minor version (x) of 4.x in such case.  If it
-   is not GCC or it is GCC older than 4.x return -1.  If it is GCC 5.x or
-   higher return INT_MAX.  */
-
-static int
-producer_is_gcc_ge_4 (struct dwarf2_cu *cu)
-{
-  const char *cs;
-  int major, minor;
-
-  if (cu->producer == NULL)
-    {
-      /* For unknown compilers expect their behavior is not compliant.  For GCC
-        this case can also happen for -gdwarf-4 type units supported since
-        gcc-4.5.  */
-
-      return -1;
-    }
-
-  /* Skip any identifier after "GNU " - such as "C++" or "Java".  */
-
-  if (strncmp (cu->producer, "GNU ", strlen ("GNU ")) != 0)
-    {
-      /* For non-GCC compilers expect their behavior is not compliant.  */
-
-      return -1;
-    }
-  cs = &cu->producer[strlen ("GNU ")];
-  while (*cs && !isdigit (*cs))
-    cs++;
-  if (sscanf (cs, "%d.%d", &major, &minor) != 2)
-    {
-      /* Not recognized as GCC.  */
-
-      return -1;
-    }
-
-  if (major < 4)
-    return -1;
-  if (major > 4)
-    return INT_MAX;
-  return minor;
-}
-
 /* Generate full symbol information for PST and CU, whose DIEs have
    already been loaded into memory.  */
 
@@ -4806,7 +4762,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
 
   if (symtab != NULL)
     {
-      int gcc_4_minor = producer_is_gcc_ge_4 (cu);
+      int gcc_4_minor = producer_is_gcc_ge_4 (cu->producer);
 
       /* Set symtab language to language from DW_AT_language.  If the
         compilation is from a C file generated by language preprocessors, do
@@ -4829,9 +4785,6 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
 
       if (gcc_4_minor >= 5)
        symtab->epilogue_unwind_valid = 1;
-
-      if (gcc_4_minor >= 6)
-       symtab->amd64_prologue_line_bug = 1;
     }
 
   if (dwarf2_per_objfile->using_index)
@@ -13901,9 +13854,9 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr,
   return die;
 }
 
-/* Return DWARF block and its CU referenced by OFFSET at PER_CU.  Returned
-   value is intended for DW_OP_call*.  You must call xfree on returned
-   dwarf2_locexpr_baton->data.  */
+/* Return DWARF block referenced by DW_AT_location of DIE at OFFSET at PER_CU.
+   Returned value is intended for DW_OP_call*.  Returned
+   dwarf2_locexpr_baton->data has lifetime of PER_CU->OBJFILE.  */
 
 struct dwarf2_locexpr_baton
 dwarf2_fetch_die_location_block (unsigned int offset,
@@ -13959,9 +13912,6 @@ dwarf2_fetch_die_location_block (unsigned int offset,
     }
   retval.per_cu = cu->per_cu;
 
-  if (retval.data)
-    retval.data = xmemdup (retval.data, retval.size, retval.size);
-
   age_cached_comp_units ();
 
   return retval;
This page took 0.030729 seconds and 4 git commands to generate.