+2009-06-11 Richard Henderson <rth@redhat.com>
+
+ * gcc-interface/misc.c (gnat_handle_option): Rename
+ OPT_gdwarf_ to OPT_gdwarfplus.
+
2009-06-11 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Resolve_Attribute, case 'access): Add missing
* gcc-interface/Make-lang.in: Fix formatting.
2009-06-01 Olivier Hainque <hainque@adacore.com>
- Eric Botcazou <ebotcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (convert) <CONSTRUCTOR case>: When converting
to the packable version of the type, clear TREE_STATIC/TREE_CONSTANT
as a static constant any more.
2009-06-01 Olivier Hainque <hainque@adacore.com>
- Eric Botcazou <ebotcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.c (gnat_build_constructor): Factor
out code. Use initializer_constant_valid_for_bitfield_p and
GPS.
* sinput.ads, sinput.adb (Expr_First_Char): New function
- (Expr_Last_Char): New function
+ (Expr_Last_Char): New function
2009-05-06 Sergey Rybin <rybin@adacore.com>
* prj-proc.adb, prj.adb, prj.ads, prj-nmsc.adb, prj-env.adb
(Source_Iterator): new type.
- This removes the need for having the sources on three different
- lists at the project tree, project and language level. They are now
- on a single list.
+ This removes the need for having the sources on three different
+ lists at the project tree, project and language level. They are now
+ on a single list.
2009-04-24 Emmanuel Briot <briot@adacore.com>
efficient.
2009-04-24 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
- Thomas Quinot <quinot@adacore.com>
+ Thomas Quinot <quinot@adacore.com>
* fe.h (Set_Identifier_Casing): Add const to second parameter.
* gcc-interface/misc.c (internal_error_function): Make copy of return
2009-04-09 Robert Dewar <dewar@adacore.com>
- * checks.adb:
- (Insert_Valid_Check): Avoid unnecessary generation of junk declaration
- when no invalid values exist, Avoid duplicate read of atomic variable.
+ * checks.adb:
+ (Insert_Valid_Check): Avoid unnecessary generation of junk declaration
+ when no invalid values exist, Avoid duplicate read of atomic variable.
- * cstand.adb (Build_Signed_Integer_Type): Set Is_Known_Valid
- (Standard_Unsigned): Set Is_Known_Valid
+ * cstand.adb (Build_Signed_Integer_Type): Set Is_Known_Valid
+ (Standard_Unsigned): Set Is_Known_Valid
- * sem_ch3.adb (Analyze_Subtype_Declaration): Copy Is_Known_Valid on
+ * sem_ch3.adb (Analyze_Subtype_Declaration): Copy Is_Known_Valid on
subtype declaration if no constraint.
- (Set_Modular_Size): Set Is_Known_Valid if appropriate
- (Build_Derived_Numeric_Type): Copy Is_Known_Valid if no constraint
+ (Set_Modular_Size): Set Is_Known_Valid if appropriate
+ (Build_Derived_Numeric_Type): Copy Is_Known_Valid if no constraint
2009-04-09 Robert Dewar <dewar@adacore.com>
#define DWARF_INITIAL_LENGTH_SIZE (DWARF_OFFSET_SIZE == 4 ? 4 : 12)
#endif
-#define DWARF_VERSION 2
-
/* Round SIZE up to the nearest BOUNDARY. */
#define DWARF_ROUND(SIZE,BOUNDARY) \
((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY))
gcc_assert (fde != NULL);
- /* We still have to add the cfi to the list so that
- lookup_cfa works later on. When -g2 and above we
- even need to force emitting of CFI labels and
- add to list a DW_CFA_set_loc for convert_cfa_to_fb_loc_list
- purposes. */
- switch (cfi->dw_cfi_opc)
+ /* We still have to add the cfi to the list so that lookup_cfa
+ works later on. When -g2 and above we even need to force
+ emitting of CFI labels and add to list a DW_CFA_set_loc for
+ convert_cfa_to_fb_loc_list purposes. If we're generating
+ DWARF3 output we use DW_OP_call_frame_cfa and so don't use
+ convert_cfa_to_fb_loc_list. */
+ if (dwarf_version == 2
+ && debug_info_level > DINFO_LEVEL_TERSE
+ && (write_symbols == DWARF2_DEBUG
+ || write_symbols == VMS_AND_DWARF2_DEBUG))
{
- case DW_CFA_def_cfa_offset:
- case DW_CFA_def_cfa_offset_sf:
- case DW_CFA_def_cfa_register:
- case DW_CFA_def_cfa:
- case DW_CFA_def_cfa_sf:
- case DW_CFA_def_cfa_expression:
- case DW_CFA_restore_state:
- if (write_symbols != DWARF2_DEBUG
- && write_symbols != VMS_AND_DWARF2_DEBUG)
- break;
- if (debug_info_level <= DINFO_LEVEL_TERSE)
- break;
-
- if (*label == 0 || strcmp (label, "<do not output>") == 0)
- label = dwarf2out_cfi_label (true);
-
- if (fde->dw_fde_current_label == NULL
- || strcmp (label, fde->dw_fde_current_label) != 0)
+ switch (cfi->dw_cfi_opc)
{
- dw_cfi_ref xcfi;
-
- label = xstrdup (label);
-
- /* Set the location counter to the new label. */
- xcfi = new_cfi ();
- /* It doesn't metter whether DW_CFA_set_loc
- or DW_CFA_advance_loc4 is added here, those aren't
- emitted into assembly, only looked up by
- convert_cfa_to_fb_loc_list. */
- xcfi->dw_cfi_opc = DW_CFA_set_loc;
- xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
- add_cfi (&fde->dw_fde_cfi, xcfi);
- fde->dw_fde_current_label = label;
- }
- break;
- default:
- break;
+ case DW_CFA_def_cfa_offset:
+ case DW_CFA_def_cfa_offset_sf:
+ case DW_CFA_def_cfa_register:
+ case DW_CFA_def_cfa:
+ case DW_CFA_def_cfa_sf:
+ case DW_CFA_def_cfa_expression:
+ case DW_CFA_restore_state:
+ if (*label == 0 || strcmp (label, "<do not output>") == 0)
+ label = dwarf2out_cfi_label (true);
+
+ if (fde->dw_fde_current_label == NULL
+ || strcmp (label, fde->dw_fde_current_label) != 0)
+ {
+ dw_cfi_ref xcfi;
+
+ label = xstrdup (label);
+
+ /* Set the location counter to the new label. */
+ xcfi = new_cfi ();
+ /* It doesn't metter whether DW_CFA_set_loc
+ or DW_CFA_advance_loc4 is added here, those aren't
+ emitted into assembly, only looked up by
+ convert_cfa_to_fb_loc_list. */
+ xcfi->dw_cfi_opc = DW_CFA_set_loc;
+ xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
+ add_cfi (&fde->dw_fde_cfi, xcfi);
+ fde->dw_fde_current_label = label;
+ }
+ break;
+ default:
+ break;
+ }
}
output_cfi_directive (cfi);
int per_encoding = DW_EH_PE_absptr;
int lsda_encoding = DW_EH_PE_absptr;
int return_reg;
+ int dw_cie_version;
/* Don't emit a CIE if there won't be any FDEs. */
if (fde_table_in_use == 0)
(for_eh ? 0 : DWARF_CIE_ID),
"CIE Identifier Tag");
- dw2_asm_output_data (1, DW_CIE_VERSION, "CIE Version");
+ /* Use the CIE version 3 for DWARF3; allow DWARF2 to continue to
+ use CIE version 1, unless that would produce incorrect results
+ due to overflowing the return register column. */
+ return_reg = DWARF2_FRAME_REG_OUT (DWARF_FRAME_RETURN_COLUMN, for_eh);
+ dw_cie_version = 1;
+ if (return_reg >= 256 || dwarf_version > 2)
+ dw_cie_version = 3;
+ dw2_asm_output_data (1, dw_cie_version, "CIE Version");
augmentation[0] = 0;
augmentation_size = 0;
dw2_asm_output_data_sleb128 (DWARF_CIE_DATA_ALIGNMENT,
"CIE Data Alignment Factor");
- return_reg = DWARF2_FRAME_REG_OUT (DWARF_FRAME_RETURN_COLUMN, for_eh);
- if (DW_CIE_VERSION == 1)
+ if (dw_cie_version == 1)
dw2_asm_output_data (1, return_reg, "CIE RA Column");
else
dw2_asm_output_data_uleb128 (return_reg, "CIE RA Column");
return "DW_OP_xderef_size";
case DW_OP_nop:
return "DW_OP_nop";
+
case DW_OP_push_object_address:
return "DW_OP_push_object_address";
case DW_OP_call2:
return "DW_OP_call4";
case DW_OP_call_ref:
return "DW_OP_call_ref";
+ case DW_OP_form_tls_address:
+ return "DW_OP_form_tls_address";
+ case DW_OP_call_frame_cfa:
+ return "DW_OP_call_frame_cfa";
+ case DW_OP_bit_piece:
+ return "DW_OP_bit_piece";
+
case DW_OP_GNU_push_tls_address:
return "DW_OP_GNU_push_tls_address";
case DW_OP_GNU_uninit:
return "DW_OP_GNU_uninit";
+ case DW_OP_GNU_encoded_addr:
+ return "DW_OP_GNU_encoded_addr";
+
default:
return "OP_<unknown>";
}
#ifndef DEBUG_PUBNAMES_SECTION
#define DEBUG_PUBNAMES_SECTION ".debug_pubnames"
#endif
+#ifndef DEBUG_PUBTYPES_SECTION
+#define DEBUG_PUBTYPES_SECTION ".debug_pubtypes"
+#endif
#ifndef DEBUG_STR_SECTION
#define DEBUG_STR_SECTION ".debug_str"
#endif
&& AT_ref (a)->die_mark == 0)
{
gcc_assert (AT_ref (a)->die_symbol);
-
set_AT_ref_external (a, 1);
}
size += 1;
break;
case dw_val_class_die_ref:
- if (AT_ref_external (a))
+ /* In DWARF2, DW_FORM_ref_addr is sized by target address length,
+ whereas in DWARF3 it's always sized as an offset. */
+ if (AT_ref_external (a) && dwarf_version == 2)
size += DWARF2_ADDR_SIZE;
else
size += DWARF_OFFSET_SIZE;
if (AT_ref_external (a))
{
char *sym = AT_ref (a)->die_symbol;
+ int size;
gcc_assert (sym);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, sym, debug_info_section,
- "%s", name);
+
+ /* In DWARF2, DW_FORM_ref_addr is sized by target address
+ length, whereas in DWARF3 it's always sized as an offset. */
+ if (dwarf_version == 2)
+ size = DWARF2_ADDR_SIZE;
+ else
+ size = DWARF_OFFSET_SIZE;
+ dw2_asm_output_offset (size, sym, debug_info_section, "%s", name);
}
else
{
dw2_asm_output_data (DWARF_OFFSET_SIZE,
next_die_offset - DWARF_INITIAL_LENGTH_SIZE,
"Length of Compilation Unit Info");
- dw2_asm_output_data (2, DWARF_VERSION, "DWARF version number");
+ dw2_asm_output_data (2, dwarf_version, "DWARF version number");
dw2_asm_output_offset (DWARF_OFFSET_SIZE, abbrev_section_label,
debug_abbrev_section,
"Offset Into Abbrev. Section");
static void
add_pubname (tree decl, dw_die_ref die)
{
-
if (TREE_PUBLIC (decl))
add_pubname_string (dwarf2_name (decl, 1), die);
}
else
dw2_asm_output_data (DWARF_OFFSET_SIZE, pubnames_length,
"Length of Public Type Names Info");
- dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
+ /* Version number for pubnames/pubtypes is still 2, even in DWARF3. */
+ dw2_asm_output_data (2, 2, "DWARF Version");
dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
debug_info_section,
"Offset of Compilation Unit Info");
"Initial length escape value indicating 64-bit DWARF extension");
dw2_asm_output_data (DWARF_OFFSET_SIZE, aranges_length,
"Length of Address Ranges Info");
- dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
+ /* Version number for aranges is still 2, even in DWARF3. */
+ dw2_asm_output_data (2, 2, "DWARF Version");
dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
debug_info_section,
"Offset of Compilation Unit Info");
"Length of Source Line Info");
ASM_OUTPUT_LABEL (asm_out_file, l1);
- dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
+ dw2_asm_output_data (2, dwarf_version, "DWARF Version");
dw2_asm_output_delta (DWARF_OFFSET_SIZE, p2, p1, "Prolog Length");
ASM_OUTPUT_LABEL (asm_out_file, p1);
(3) We can at least reuse the code inspection and interpretation
code that determines the CFA position at various points in the
function. */
- /* ??? Use some command-line or configury switch to enable the use
- of dwarf3 DW_OP_call_frame_cfa. At present there are no dwarf
- consumers that understand it; fall back to "pure" dwarf2 and
- convert the CFA data into a location list. */
- {
- dw_loc_list_ref list = convert_cfa_to_fb_loc_list (cfa_fb_offset);
- if (list->dw_loc_next)
- add_AT_loc_list (subr_die, DW_AT_frame_base, list);
- else
- add_AT_loc (subr_die, DW_AT_frame_base, list->expr);
- }
+ if (dwarf_version >= 3)
+ {
+ dw_loc_descr_ref op = new_loc_descr (DW_OP_call_frame_cfa, 0, 0);
+ add_AT_loc (subr_die, DW_AT_frame_base, op);
+ }
+ else
+ {
+ dw_loc_list_ref list = convert_cfa_to_fb_loc_list (cfa_fb_offset);
+ if (list->dw_loc_next)
+ add_AT_loc_list (subr_die, DW_AT_frame_base, list);
+ else
+ add_AT_loc (subr_die, DW_AT_frame_base, list->expr);
+ }
/* Compute a displacement from the "steady-state frame pointer" to
the CFA. The former is what all stack slots and argument slots
SECTION_DEBUG, NULL);
debug_pubnames_section = get_section (DEBUG_PUBNAMES_SECTION,
SECTION_DEBUG, NULL);
-#ifdef DEBUG_PUBTYPES_SECTION
debug_pubtypes_section = get_section (DEBUG_PUBTYPES_SECTION,
SECTION_DEBUG, NULL);
-#endif
debug_str_section = get_section (DEBUG_STR_SECTION,
DEBUG_STR_SECTION_FLAGS, NULL);
debug_ranges_section = get_section (DEBUG_RANGES_SECTION,
output_pubnames (pubname_table);
}
-#ifdef DEBUG_PUBTYPES_SECTION
/* Output public types table if necessary. */
+ /* ??? Only defined by DWARF3, but emitted by Darwin for DWARF2.
+ It shouldn't hurt to emit it always, since pure DWARF2 consumers
+ simply won't look for the section. */
if (!VEC_empty (pubname_entry, pubtype_table))
{
switch_to_section (debug_pubtypes_section);
output_pubnames (pubtype_table);
}
-#endif
/* Output the address range information. We only put functions in the arange
table, so don't write it out if we don't have any. */