{
unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
- return lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus;
+ return (lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus
+ || lang == DW_LANG_C_plus_plus_11 || lang == DW_LANG_C_plus_plus_14);
}
/* Return TRUE if the language is Java. */
static void
output_compilation_unit_header (void)
{
- int ver = dwarf_version;
+ /* We don't support actual DWARFv5 units yet, we just use some
+ DWARFv5 draft DIE tags in DWARFv4 format. */
+ int ver = dwarf_version < 5 ? dwarf_version : 4;
if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
dw2_asm_output_data (4, 0xffffffff,
static void
output_skeleton_debug_sections (dw_die_ref comp_unit)
{
+ /* We don't support actual DWARFv5 units yet, we just use some
+ DWARFv5 draft DIE tags in DWARFv4 format. */
+ int ver = dwarf_version < 5 ? dwarf_version : 4;
+
/* These attributes will be found in the full debug_info section. */
remove_AT (comp_unit, DW_AT_producer);
remove_AT (comp_unit, DW_AT_language);
- DWARF_INITIAL_LENGTH_SIZE
+ size_of_die (comp_unit),
"Length of Compilation Unit Info");
- dw2_asm_output_data (2, dwarf_version, "DWARF version number");
+ dw2_asm_output_data (2, ver, "DWARF version number");
dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_skeleton_abbrev_section_label,
debug_abbrev_section,
"Offset Into Abbrev. Section");
"Initial length escape value indicating 64-bit DWARF extension");
dw2_asm_output_data (DWARF_OFFSET_SIZE, aranges_length,
"Length of Address Ranges Info");
- /* Version number for aranges is still 2, even in DWARF3. */
+ /* Version number for aranges is still 2, even up to DWARF5. */
dw2_asm_output_data (2, 2, "DWARF Version");
if (dwarf_split_debug_info)
dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_skeleton_info_section_label,
output_line_info (bool prologue_only)
{
char l1[20], l2[20], p1[20], p2[20];
- int ver = dwarf_version;
+ /* We don't support DWARFv5 line tables yet. */
+ int ver = dwarf_version < 5 ? dwarf_version : 4;
bool saw_one = false;
int opc;
case DW_LANG_C:
case DW_LANG_C89:
case DW_LANG_C99:
+ case DW_LANG_C11:
case DW_LANG_C_plus_plus:
+ case DW_LANG_C_plus_plus_11:
+ case DW_LANG_C_plus_plus_14:
case DW_LANG_ObjC:
case DW_LANG_ObjC_plus_plus:
case DW_LANG_Java:
case DW_LANG_C:
case DW_LANG_C89:
case DW_LANG_C99:
+ case DW_LANG_C11:
case DW_LANG_ObjC:
if (prototype_p (func_type))
add_AT_flag (die, DW_AT_prototyped, 1);
language = DW_LANG_C;
if (strncmp (language_string, "GNU C", 5) == 0
- && (language_string[5] == 0 || ISDIGIT (language_string[5])))
+ && ISDIGIT (language_string[5]))
{
language = DW_LANG_C89;
if (dwarf_version >= 3 || !dwarf_strict)
- if (strcmp (language_string, "GNU C99") == 0)
- language = DW_LANG_C99;
+ {
+ if (strcmp (language_string, "GNU C89") != 0)
+ language = DW_LANG_C99;
+
+ if (dwarf_version >= 5 /* || !dwarf_strict */)
+ if (strcmp (language_string, "GNU C11") == 0)
+ language = DW_LANG_C11;
+ }
}
else if (strncmp (language_string, "GNU C++", 7) == 0)
- language = DW_LANG_C_plus_plus;
+ {
+ language = DW_LANG_C_plus_plus;
+ if (dwarf_version >= 5 /* || !dwarf_strict */)
+ {
+ if (strcmp (language_string, "GNU C++11") == 0)
+ language = DW_LANG_C_plus_plus_11;
+ else if (strcmp (language_string, "GNU C++14") == 0)
+ language = DW_LANG_C_plus_plus_14;
+ }
+ }
else if (strcmp (language_string, "GNU F77") == 0)
language = DW_LANG_Fortran77;
else if (strcmp (language_string, "GNU Pascal") == 0)