On Tue, Mar 29, 2011 at 12:20:32PM +0200, Mark Wielaard wrote: > Some dwarf consumers (dwarves, systemtap and dwarflint) grok Dwarf V4, > but not yet the new .debug_types section. To make it easier to use these > tools with -gdwarf-4 this patch introduces a new > -fno-debug-types-section flag and guards all code that is type unit > specific with use_debug_types instead of a generic dwarf_version >= 4 > flag. IMHO this makes the code also slightly more readable. And it > re-enables the usage of -feliminate-dwarf2-dups with -gdwarf-4. Although > admittedly the value of that is probably pretty low. I found it helpful > in debugging some issues with dwarf consumers and DW_FORM_ref_addr > usage.
While backporting your patch I've noticed a couple of minor issues. 1) common.opt is supposed to be ASCII sorted (clearly many options violate that, but most of the file is actually sorted) 2) there was a missing @gol 3) there is no -f{,no-}-types-section switch 4) DWARF is spelled in capital letters everywhere else in doc/invoke.texi Committed as obvious to trunk. 2011-03-31 Jakub Jelinek <ja...@redhat.com> * common.opt (fdebug-types-section): Move earlier. * doc/invoke.texi: Fix up -fno-debug-types-section documentation. --- gcc/common.opt (revision 171771) +++ gcc/common.opt (working copy) @@ -918,6 +918,10 @@ fdebug-prefix-map= Common Joined RejectNegative Var(common_deferred_options) Defer Map one directory name to another in debug information +fdebug-types-section +Common Report Var(flag_debug_types_section) Init(1) +Output .debug_types section when using DWARF v4 debuginfo. + ; Nonzero for -fdefer-pop: don't pop args after each function call ; instead save them up to pop many calls' args with one insns. fdefer-pop @@ -1012,10 +1016,6 @@ femit-class-debug-always Common Report Var(flag_emit_class_debug_always) Init(0) Do not suppress C++ class debug information. -fdebug-types-section -Common Report Var(flag_debug_types_section) Init(1) -Output .debug_types section when using DWARF v4 debuginfo. - fexceptions Common Report Var(flag_exceptions) Optimization Enable exception handling --- gcc/doc/invoke.texi (revision 171771) +++ gcc/doc/invoke.texi (working copy) @@ -312,7 +312,7 @@ Objective-C and Objective-C++ Dialects}. -fdump-final-insns=@var{file} @gol -fcompare-debug@r{[}=@var{opts}@r{]} -fcompare-debug-second @gol -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol --feliminate-unused-debug-symbols -femit-class-debug-always +-feliminate-unused-debug-symbols -femit-class-debug-always @gol -fdebug-types-section @gol -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol @@ -4587,13 +4587,13 @@ option will increase the size of debuggi factor of two. @item -fno-debug-types-section -@opindex fno-types-section -@opindex ftypes-section -By default when using Dwarf v4 or higher type DIEs will be put into +@opindex fno-debug-types-section +@opindex fdebug-types-section +By default when using DWARF v4 or higher type DIEs will be put into their own .debug_types section instead of making them part of the .debug_info section. It is more efficient to put them in a separate comdat sections since the linker will then be able to remove duplicates. -But not all dwarf consumers support .debug_types sections yet. +But not all DWARF consumers support .debug_types sections yet. @item -gstabs+ @opindex gstabs+ Jakub