}
}
-/* 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. */
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
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)
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,
}
retval.per_cu = cu->per_cu;
- if (retval.data)
- retval.data = xmemdup (retval.data, retval.size, retval.size);
-
age_cached_comp_units ();
return retval;