Commit 2bee6045 by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (dw_val_class): Add dw_val_class_range_list.

	* dwarf2out.c (dw_val_class): Add dw_val_class_range_list.
	(DEBUG_RANGES_SECTION_LABEL): Define.
	(ranges_section_label): Add.
	(add_AT_range_list): New.
	(print_die, sizeof_die, value_format): Handle dw_val_class_range_list.
	(output_loc_list): Location expression length is always 2-byte.
	(output_die): Handle dw_val_class_range_list.
	(gen_lexical_block_die): Call add_AT_range_list.
	(dwarf2out_init): Initialize ranges_section_label.
	(dwarf2out_finish): Emit ranges_section_label.

From-SVN: r47946
parent 59c83dbf
2001-12-12 Jakub Jelinek <jakub@redhat.com> 2001-12-12 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (dw_val_class): Add dw_val_class_range_list.
(DEBUG_RANGES_SECTION_LABEL): Define.
(ranges_section_label): Add.
(add_AT_range_list): New.
(print_die, sizeof_die, value_format): Handle dw_val_class_range_list.
(output_loc_list): Location expression length is always 2-byte.
(output_die): Handle dw_val_class_range_list.
(gen_lexical_block_die): Call add_AT_range_list.
(dwarf2out_init): Initialize ranges_section_label.
(dwarf2out_finish): Emit ranges_section_label.
2001-12-12 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (digest_init): Allow initializing * c-typeck.c (digest_init): Allow initializing
static storage duration objects with compound literals. static storage duration objects with compound literals.
* doc/extend.texi (Compound literals): Document the extension. * doc/extend.texi (Compound literals): Document the extension.
......
...@@ -2140,6 +2140,7 @@ typedef enum ...@@ -2140,6 +2140,7 @@ typedef enum
dw_val_class_offset, dw_val_class_offset,
dw_val_class_loc, dw_val_class_loc,
dw_val_class_loc_list, dw_val_class_loc_list,
dw_val_class_range_list,
dw_val_class_const, dw_val_class_const,
dw_val_class_unsigned_const, dw_val_class_unsigned_const,
dw_val_class_long_long, dw_val_class_long_long,
...@@ -3447,6 +3448,9 @@ static void add_AT_lbl_offset PARAMS ((dw_die_ref, ...@@ -3447,6 +3448,9 @@ static void add_AT_lbl_offset PARAMS ((dw_die_ref,
static void add_AT_offset PARAMS ((dw_die_ref, static void add_AT_offset PARAMS ((dw_die_ref,
enum dwarf_attribute, enum dwarf_attribute,
unsigned long)); unsigned long));
static void add_AT_range_list PARAMS ((dw_die_ref,
enum dwarf_attribute,
unsigned long));
static dw_attr_ref get_AT PARAMS ((dw_die_ref, static dw_attr_ref get_AT PARAMS ((dw_die_ref,
enum dwarf_attribute)); enum dwarf_attribute));
static const char *get_AT_low_pc PARAMS ((dw_die_ref)); static const char *get_AT_low_pc PARAMS ((dw_die_ref));
...@@ -3672,6 +3676,9 @@ static char *gen_internal_sym PARAMS ((const char *)); ...@@ -3672,6 +3676,9 @@ static char *gen_internal_sym PARAMS ((const char *));
#ifndef DEBUG_LOC_SECTION_LABEL #ifndef DEBUG_LOC_SECTION_LABEL
#define DEBUG_LOC_SECTION_LABEL "Ldebug_loc" #define DEBUG_LOC_SECTION_LABEL "Ldebug_loc"
#endif #endif
#ifndef DEBUG_RANGES_SECTION_LABEL
#define DEBUG_RANGES_SECTION_LABEL "Ldebug_ranges"
#endif
#ifndef DEBUG_MACINFO_SECTION_LABEL #ifndef DEBUG_MACINFO_SECTION_LABEL
#define DEBUG_MACINFO_SECTION_LABEL "Ldebug_macinfo" #define DEBUG_MACINFO_SECTION_LABEL "Ldebug_macinfo"
#endif #endif
...@@ -3689,6 +3696,7 @@ static char debug_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; ...@@ -3689,6 +3696,7 @@ static char debug_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
static char macinfo_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char macinfo_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
static char loc_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char loc_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
static char ranges_section_label[2 * MAX_ARTIFICIAL_LABEL_BYTES];
#ifndef TEXT_END_LABEL #ifndef TEXT_END_LABEL
#define TEXT_END_LABEL "Letext" #define TEXT_END_LABEL "Letext"
#endif #endif
...@@ -4699,7 +4707,7 @@ add_AT_lbl_offset (die, attr_kind, label) ...@@ -4699,7 +4707,7 @@ add_AT_lbl_offset (die, attr_kind, label)
/* Add an offset attribute value to a DIE. */ /* Add an offset attribute value to a DIE. */
static void static inline void
add_AT_offset (die, attr_kind, offset) add_AT_offset (die, attr_kind, offset)
dw_die_ref die; dw_die_ref die;
enum dwarf_attribute attr_kind; enum dwarf_attribute attr_kind;
...@@ -4714,6 +4722,23 @@ add_AT_offset (die, attr_kind, offset) ...@@ -4714,6 +4722,23 @@ add_AT_offset (die, attr_kind, offset)
add_dwarf_attr (die, attr); add_dwarf_attr (die, attr);
} }
/* Add an range_list attribute value to a DIE. */
static void
add_AT_range_list (die, attr_kind, offset)
dw_die_ref die;
enum dwarf_attribute attr_kind;
unsigned long offset;
{
dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
attr->dw_attr_val.val_class = dw_val_class_range_list;
attr->dw_attr_val.v.val_offset = offset;
add_dwarf_attr (die, attr);
}
static inline const char *AT_lbl PARAMS ((dw_attr_ref)); static inline const char *AT_lbl PARAMS ((dw_attr_ref));
static inline const char * static inline const char *
AT_lbl (a) AT_lbl (a)
...@@ -5147,6 +5172,9 @@ print_die (die, outfile) ...@@ -5147,6 +5172,9 @@ print_die (die, outfile)
fprintf (outfile, "location list -> label:%s", fprintf (outfile, "location list -> label:%s",
AT_loc_list (a)->ll_symbol); AT_loc_list (a)->ll_symbol);
break; break;
case dw_val_class_range_list:
fprintf (outfile, "range list");
break;
case dw_val_class_const: case dw_val_class_const:
fprintf (outfile, "%ld", AT_int (a)); fprintf (outfile, "%ld", AT_int (a));
break; break;
...@@ -5818,6 +5846,9 @@ size_of_die (die) ...@@ -5818,6 +5846,9 @@ size_of_die (die)
case dw_val_class_loc_list: case dw_val_class_loc_list:
size += DWARF_OFFSET_SIZE; size += DWARF_OFFSET_SIZE;
break; break;
case dw_val_class_range_list:
size += DWARF_OFFSET_SIZE;
break;
case dw_val_class_const: case dw_val_class_const:
size += size_of_sleb128 (AT_int (a)); size += size_of_sleb128 (AT_int (a));
break; break;
...@@ -5956,6 +5987,7 @@ value_format (a) ...@@ -5956,6 +5987,7 @@ value_format (a)
{ {
case dw_val_class_addr: case dw_val_class_addr:
return DW_FORM_addr; return DW_FORM_addr;
case dw_val_class_range_list:
case dw_val_class_offset: case dw_val_class_offset:
if (DWARF_OFFSET_SIZE == 4) if (DWARF_OFFSET_SIZE == 4)
return DW_FORM_data4; return DW_FORM_data4;
...@@ -6147,7 +6179,7 @@ output_loc_list (list_head) ...@@ -6147,7 +6179,7 @@ output_loc_list (list_head)
} }
for (curr = list_head; curr != NULL; curr=curr->dw_loc_next) for (curr = list_head; curr != NULL; curr=curr->dw_loc_next)
{ {
int size; unsigned long size;
dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->begin, curr->section, dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->begin, curr->section,
"Location list begin address (%s)", "Location list begin address (%s)",
list_head->ll_symbol); list_head->ll_symbol);
...@@ -6157,9 +6189,10 @@ output_loc_list (list_head) ...@@ -6157,9 +6189,10 @@ output_loc_list (list_head)
size = size_of_locs (curr->expr); size = size_of_locs (curr->expr);
/* Output the block length for this list of location operations. */ /* Output the block length for this list of location operations. */
dw2_asm_output_data (constant_size (size), size, "%s", if (size > 0xffff)
"Location expression size"); abort ();
dw2_asm_output_data (2, size, "%s", "Location expression size");
output_loc_sequence (curr->expr); output_loc_sequence (curr->expr);
} }
dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, dw2_asm_output_data (DWARF_OFFSET_SIZE, 0,
...@@ -6204,6 +6237,17 @@ output_die (die) ...@@ -6204,6 +6237,17 @@ output_die (die)
"%s", name); "%s", name);
break; break;
case dw_val_class_range_list:
{
char *p = strchr (ranges_section_label, '\0');
sprintf (p, "+0x%lx", a->dw_attr_val.v.val_offset);
dw2_asm_output_offset (DWARF_OFFSET_SIZE, ranges_section_label,
"%s", name);
*p = '\0';
}
break;
case dw_val_class_loc: case dw_val_class_loc:
size = size_of_locs (AT_loc (a)); size = size_of_locs (AT_loc (a));
...@@ -10388,7 +10432,7 @@ gen_lexical_block_die (stmt, context_die, depth) ...@@ -10388,7 +10432,7 @@ gen_lexical_block_die (stmt, context_die, depth)
{ {
tree chain; tree chain;
add_AT_offset (stmt_die, DW_AT_ranges, add_ranges (stmt)); add_AT_range_list (stmt_die, DW_AT_ranges, add_ranges (stmt));
chain = BLOCK_FRAGMENT_CHAIN (stmt); chain = BLOCK_FRAGMENT_CHAIN (stmt);
do do
...@@ -11832,6 +11876,8 @@ dwarf2out_init (main_input_filename) ...@@ -11832,6 +11876,8 @@ dwarf2out_init (main_input_filename)
DEBUG_INFO_SECTION_LABEL, 0); DEBUG_INFO_SECTION_LABEL, 0);
ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
DEBUG_LINE_SECTION_LABEL, 0); DEBUG_LINE_SECTION_LABEL, 0);
ASM_GENERATE_INTERNAL_LABEL (ranges_section_label,
DEBUG_RANGES_SECTION_LABEL, 0);
named_section_flags (DEBUG_ABBREV_SECTION, SECTION_DEBUG); named_section_flags (DEBUG_ABBREV_SECTION, SECTION_DEBUG);
ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label); ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label);
named_section_flags (DEBUG_INFO_SECTION, SECTION_DEBUG); named_section_flags (DEBUG_INFO_SECTION, SECTION_DEBUG);
...@@ -12023,6 +12069,7 @@ dwarf2out_finish (input_filename) ...@@ -12023,6 +12069,7 @@ dwarf2out_finish (input_filename)
if (ranges_table_in_use) if (ranges_table_in_use)
{ {
named_section_flags (DEBUG_RANGES_SECTION, SECTION_DEBUG); named_section_flags (DEBUG_RANGES_SECTION, SECTION_DEBUG);
ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
output_ranges (); output_ranges ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment