Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-15 Thread Eric Botcazou
  I wasn't trying to be pompous! It's just our project name, but I
  thought fission to be quite appropriate for what it does. How does
  -gsplit or -gsplit-dwarf work for you?

 Or -gsplit-debug?

-g is already supposed to convey the debug, so I think that -gsplit-dwarf is 
the best proposal (and we already have -gstrict-dwarf for example).  Thanks.

-- 
Eric Botcazou


Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Eric Botcazou
 For google/gcc-4_6 branch. (To be submitted for trunk soon.)

The option name sounds like the brainchild of the marketing department. :-)
Can we avoid going nuclear in the compiler and use something more mundane?

-- 
Eric Botcazou


Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Diego Novillo

On 13/03/12 04:14 , Eric Botcazou wrote:

For google/gcc-4_6 branch. (To be submitted for trunk soon.)


The option name sounds like the brainchild of the marketing department. :-)
Can we avoid going nuclear in the compiler and use something more mundane?


I, for one, welcome our new nuclear overlords.





Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Eric Botcazou
 I, for one, welcome our new nuclear overlords.

AFAICS the internal switch is called dwarf_split_debug_info so a short moniker 
based on it would be more understandable (and avoid a useless pomposity).

-- 
Eric Botcazou


Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Cary Coutant
 I, for one, welcome our new nuclear overlords.

 AFAICS the internal switch is called dwarf_split_debug_info so a short moniker
 based on it would be more understandable (and avoid a useless pomposity).

I wasn't trying to be pompous! It's just our project name, but I
thought fission to be quite appropriate for what it does. How does
-gsplit or -gsplit-dwarf work for you?

-cary


Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Xinliang David Li
On Tue, Mar 13, 2012 at 11:56 AM, Cary Coutant ccout...@google.com wrote:
 I, for one, welcome our new nuclear overlords.

 AFAICS the internal switch is called dwarf_split_debug_info so a short 
 moniker
 based on it would be more understandable (and avoid a useless pomposity).

 I wasn't trying to be pompous! It's just our project name, but I
 thought fission to be quite appropriate for what it does. How does
 -gsplit or -gsplit-dwarf work for you?

Or -gsplit-debug?

David

 -cary


Re: [google] Add -gfission support to GCC (issue5754090)

2012-03-13 Thread Diego Novillo

On 13/03/12 15:43 , Xinliang David Li wrote:

On Tue, Mar 13, 2012 at 11:56 AM, Cary Coutantccout...@google.com  wrote:

I, for one, welcome our new nuclear overlords.


AFAICS the internal switch is called dwarf_split_debug_info so a short moniker
based on it would be more understandable (and avoid a useless pomposity).


I wasn't trying to be pompous! It's just our project name, but I
thought fission to be quite appropriate for what it does. How does
-gsplit or -gsplit-dwarf work for you?


Or -gsplit-debug?

David


You guys are boring ;)



[google] Add -gfission support to GCC (issue5754090)

2012-03-12 Thread Cary Coutant
Add GCC support for -gfission option.  Debug info is partitioned
into skeleton sections that will remain in the .o file, and dwo
sections that will be moved to a .dwo file.  After compilation,
the gcc driver calls objcopy twice: once to extract the dwo
sections into the .dwo file, and a second time to remove the
sections from the .o file.

For google/gcc-4_6 branch. (To be submitted for trunk soon.)

Tested: bootstrap,core,mantle,crust

2012-03-09  Sterling Augustine  saugust...@google.com
Cary Coutant  ccout...@google.com

* gcc.c (ASM_FINAL_SPEC): For -gfission, call objcopy.
(static_spec_functions): Add replace-extension.
(replace_extension_spec_func): New function.
* dwarf2out.c (debug_skeleton_info_section)
(debug_skeleton_abbrev_section, debug_ref_section, debug_addr_section)
(debug_skeleton_line_section, debug_str_offsets_section): New
variables.
(struct indirect_string_node): Add index field.
(DEBUG_DWO_INFO_SECTION, DEBUG_DWO_ABBREV_SECTION, DEBUG_REF_SECTION)
(DEBUG_ADDR_SECTION, DEBUG_DWO_LINE_SECTION)
(DEBUG_NORM_STR_OFFSETS_SECTION, DEBUG_DWO_STR_OFFSETS_SECTION)
(DEBUG_STR_OFFSETS_SECTION, DEBUG_DWO_STR_SECTION)
(DEBUG_NORM_STR_SECTION): New debug section macros.
(DEBUG_STR_SECTION): Change definition for -gfission.
(DEBUG_STR_SECTION_FLAGS): Don't set SECTION_MERGE for -gfission.
(DEBUG_SKELETON_LINE_SECTION_LABEL, DEBUG_SKELETON_INFO_SECTION_LABEL)
(DEBUG_SKELETON_ABBREV_SECTION_LABEL, DEBUG_REF_SECTION_LABEL)
(DEBUG_ADDR_SECTION_LABEL): New section label macros.
(SKELETON_COMP_DIE_ABBREV, SKELETON_TYPE_DIE_ABBREV): New macros.
(debug_skeleton_info_section_label, debug_skeleton_abbrev_section_label)
(debug_ref_section_label, debug_addr_section_label)
(debug_skeleton_line_section_label): New section label variables.
(dwarf_attr_name): Add new attribute names.
(dwarf_form_name): Add new form names.
(AT_index): New function.
(set_AT_index): New function.
(index_string_table): New variable.
(AT_string_form): Use DW_FORM_GNU_str_index for -gfission.
(add_addr_table_entry): New function.
(add_AT_addr): Record index for indirect references with -gfission.
(add_AT_lbl_id): Likewise.
(add_ref_table_entry): New function.
(add_AT_range_list): Use indirect reference for -gfission.
(break_out_comdat_types): Don't add DW_AT_GNU_pubnames/pubtypes
attributes here.
(size_of_die): Account for indirect forms with -gfission.
(value_format): Use indirect forms for -gfission.
(output_die_abbrevs): New function.
(output_abbrev_section): Refactor code into output_die_abbrevs.
(output_range_list_offset): New function.
(output_loc_list_offset): New function.
(output_attr_index_or_value): New function.
(output_die): Call output_attr_index_or_value to output possibly
indirect forms.  Output indirect strings for -gfission.
(add_AT_pubnames): New function.
(add_top_level_skeleton_die_attrs): New function.
(skeleton_type_unit): New variable.
(output_skeleton_debug_sections): New function.
(output_comdat_type_unit): Write to .debug_types.dwo for -gfission.
(output_pubnames): Add assembly label to beginning of section; use
label for skeleton info section with -gfission.
(output_aranges): Use label for skeleton info section with -gfission.
(output_line_info ): Add prologue_only parameter.
(dwarf2out_init): Create new sections for -gfission.
(output_index_strings): New function.
(output_ref_table): New function.
(output_addr_table): New function.
(index_location_lists): New function.
(dwarf2out_finish): For -gfission, write skeleton debug sections,
write pubnames tables unconditionally, and write indirect sections.
* opts.c (common_handle_option): Add OPT_gfission.
* common.opt: Add -gfission option.

Index: gcc.c
===
--- gcc.c   (revision 185159)
+++ gcc.c   (working copy)
@@ -265,6 +265,7 @@ static const char *compare_debug_dump_op
 static const char *compare_debug_self_opt_spec_function (int, const char **);
 static const char *compare_debug_auxbase_opt_spec_function (int, const char 
**);
 static const char *pass_through_libs_spec_func (int, const char **);
+static const char *replace_extension_spec_func (int, const char **);
 
 /* The Specs Language
 
@@ -478,7 +479,14 @@ proper position among the other output f
 /* config.h can define ASM_FINAL_SPEC to run a post processor after
the assembler has run.  */
 #ifndef ASM_FINAL_SPEC
-#define ASM_FINAL_SPEC 
+#define ASM_FINAL_SPEC \
+  %{gfission: \n\
+   objcopy --extract-dwo \
+

[google] Add -gfission support to GCC (issue5754090)

2012-03-12 Thread Cary Coutant
[Revised patch to fix problem with ASM_FINAL_SPEC in the case where
neither -c nor -o are specified.]

Add GCC support for -gfission option.  Debug info is partitioned
into skeleton sections that will remain in the .o file, and dwo
sections that will be moved to a .dwo file.  After compilation,
the gcc driver calls objcopy twice: once to extract the dwo
sections into the .dwo file, and a second time to remove the
sections from the .o file.

For google/gcc-4_6 branch. (To be submitted for trunk soon.)

Tested: bootstrap,core,mantle,crust

2012-03-09  Sterling Augustine  saugust...@google.com
Cary Coutant  ccout...@google.com

* gcc.c (ASM_FINAL_SPEC): For -gfission, call objcopy.
(static_spec_functions): Add replace-extension.
(replace_extension_spec_func): New function.
* dwarf2out.c (debug_skeleton_info_section)
(debug_skeleton_abbrev_section, debug_ref_section, debug_addr_section)
(debug_skeleton_line_section, debug_str_offsets_section): New
variables.
(struct indirect_string_node): Add index field.
(DEBUG_DWO_INFO_SECTION, DEBUG_DWO_ABBREV_SECTION, DEBUG_REF_SECTION)
(DEBUG_ADDR_SECTION, DEBUG_DWO_LINE_SECTION)
(DEBUG_NORM_STR_OFFSETS_SECTION, DEBUG_DWO_STR_OFFSETS_SECTION)
(DEBUG_STR_OFFSETS_SECTION, DEBUG_DWO_STR_SECTION)
(DEBUG_NORM_STR_SECTION): New debug section macros.
(DEBUG_STR_SECTION): Change definition for -gfission.
(DEBUG_STR_SECTION_FLAGS): Don't set SECTION_MERGE for -gfission.
(DEBUG_SKELETON_LINE_SECTION_LABEL, DEBUG_SKELETON_INFO_SECTION_LABEL)
(DEBUG_SKELETON_ABBREV_SECTION_LABEL, DEBUG_REF_SECTION_LABEL)
(DEBUG_ADDR_SECTION_LABEL): New section label macros.
(SKELETON_COMP_DIE_ABBREV, SKELETON_TYPE_DIE_ABBREV): New macros.
(debug_skeleton_info_section_label, debug_skeleton_abbrev_section_label)
(debug_ref_section_label, debug_addr_section_label)
(debug_skeleton_line_section_label): New section label variables.
(dwarf_attr_name): Add new attribute names.
(dwarf_form_name): Add new form names.
(AT_index): New function.
(set_AT_index): New function.
(index_string_table): New variable.
(AT_string_form): Use DW_FORM_GNU_str_index for -gfission.
(add_addr_table_entry): New function.
(add_AT_addr): Record index for indirect references with -gfission.
(add_AT_lbl_id): Likewise.
(add_ref_table_entry): New function.
(add_AT_range_list): Use indirect reference for -gfission.
(break_out_comdat_types): Don't add DW_AT_GNU_pubnames/pubtypes
attributes here.
(size_of_die): Account for indirect forms with -gfission.
(value_format): Use indirect forms for -gfission.
(output_die_abbrevs): New function.
(output_abbrev_section): Refactor code into output_die_abbrevs.
(output_range_list_offset): New function.
(output_loc_list_offset): New function.
(output_attr_index_or_value): New function.
(output_die): Call output_attr_index_or_value to output possibly
indirect forms.  Output indirect strings for -gfission.
(add_AT_pubnames): New function.
(add_top_level_skeleton_die_attrs): New function.
(skeleton_type_unit): New variable.
(output_skeleton_debug_sections): New function.
(output_comdat_type_unit): Write to .debug_types.dwo for -gfission.
(output_pubnames): Add assembly label to beginning of section; use
label for skeleton info section with -gfission.
(output_aranges): Use label for skeleton info section with -gfission.
(output_line_info ): Add prologue_only parameter.
(dwarf2out_init): Create new sections for -gfission.
(output_index_strings): New function.
(output_ref_table): New function.
(output_addr_table): New function.
(index_location_lists): New function.
(dwarf2out_finish): For -gfission, write skeleton debug sections,
write pubnames tables unconditionally, and write indirect sections.
* opts.c (common_handle_option): Add OPT_gfission.
* common.opt: Add -gfission option.

Index: gcc.c
===
--- gcc.c   (revision 185159)
+++ gcc.c   (working copy)
@@ -265,6 +265,7 @@ static const char *compare_debug_dump_op
 static const char *compare_debug_self_opt_spec_function (int, const char **);
 static const char *compare_debug_auxbase_opt_spec_function (int, const char 
**);
 static const char *pass_through_libs_spec_func (int, const char **);
+static const char *replace_extension_spec_func (int, const char **);
 
 /* The Specs Language
 
@@ -478,7 +479,14 @@ proper position among the other output f
 /* config.h can define ASM_FINAL_SPEC to run a post processor after
the assembler has run.  */
 #ifndef ASM_FINAL_SPEC
-#define