[PATCH] DWARF5 .debug_rnglists support
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Tue Nov 1 20:44:00 GMT 2016
Hi Jakub,
> 2016-11-01 Jakub Jelinek <jakub@redhat.com>
>
> * tree.h (BLOCK_IN_COLD_SECTION_P): Define.
> * final.c (final_scan_insn): Set BLOCK_IN_COLD_SECTION_P.
> * dwarf2out.c (rnglist_idx): New variable.
> (struct dw_ranges): Add label, idx and maybe_new_sec fields.
> (DEBUG_RNGLISTS_SECTION): Define.
> (ranges_base_label): New variable.
> (size_of_die) <case dw_val_class_range_list>: If using
> DW_FORM_rnglistx, count size of uleb128 of range list index.
> (value_format) <case dw_val_class_range_list>: For
> -gdwarf-5 -gsplit-dwarf return DW_FORM_rnglistx.
> (output_range_list_offset): Handle -gdwarf-5 .debug_rnglists
> offsets. Multiply dwarf < 5 offsets by 2 * DWARF_ADDR_SIZE.
> (add_ranges_num): Remove useless prototype. Don't multiply
> by 2 * DWARF2_ADDR_SIZE. Add maybe_new_sec argument, adjust
> for new fields added to dw_ranges struct.
> (add_ranges): Add maybe_new_sec argument and pass it
> through to add_ranges_num.
> (note_rnglist_head): New function.
> (add_ranges_by_labels): Pass true as maybe_new_sec to
> add_ranges_num, call note_rnglist_head on the head of the list.
> (output_ranges): Add function comment. Switch to
> .debug_ranges section here and emit .Ldebug_ranges0 label.
> (index_rnglists, output_rnglists): New functions.
> (gen_subprogram_die): Formatting fixes.
> (add_high_low_attributes): Don't divide offsets
> by 2 * DWARF2_ADDR_SIZE. Call note_rnglist_head on the
> first list element or when pointing into the middle of
> a list. Pass true as second argument to add_ranges on the
> first block fragment after cold/hot section switch.
> (init_sections_and_labels): For -gdwarf-5 use .debug_rnglists
> section instead of .debug_ranges. Initialize
> ranges_base_label if -gdwarf-5 -gsplit-dwarf.
> (dwarf2out_finish): For -gdwarf-5 -gsplit-dwarf call
> index_rnglists and add DW_AT_rnglists_base attr. Don't switch
> to dwarf_ranges_section here or emit .Ldebug_ranges0 label.
> Call output_rnglists for -gdwarf-5.
> (dwarf2out_c_finalize): Clear rnglist_idx.
this patch broke Solaris bootstrap with /bin/as:
/vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c: In function 'void output_rnglists()':
/vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11055:8: error: unused variable 'basebuf' [-Werror=unused-variable]
char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
^~~~~~~
/vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11088:16: error: unused variable 'len' [-Werror=unused-variable]
unsigned int len = vec_safe_length (ranges_table);
^~~
Fixed as follows; will commit as obvious once i386-pc-solaris2.12 and
sparc-sun-solaris2.12 bootstrap have finished successfully.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2016-11-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* dwarf2out.c (output_rnglists): Wrap basebuf, len in
HAVE_AS_LEB128.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-dwarf2out-non-leb128.patch
Type: text/x-patch
Size: 859 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161101/b5f10f08/attachment.bin>
More information about the Gcc-patches
mailing list