From 052166fd4a8051c7dc4c87d408be091c99aafd55 Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 25 Apr 2012 16:59:11 +0000 Subject: [PATCH] * common.opt (flag_debug_types_section): Default to 0. (dwarf_version): Default to 4. (dwarf_record_gcc_switches): Default to 1. (dwarf_strict): Default to 0. * toplev.c (process_options): Don't handle dwarf_strict or dwarf_version here. * config/vxworks.c (vxworks_override_options): Don't test whether dwarf_strict or dwarf_version are negative, instead test !global_options_set.x_dwarf_*. * config/darwin.c (darwin_override_options): Default to dwarf_version 2. * doc/invoke.texi: Note that -gdwarf-4, -grecord-gcc-switches and -fno-debug-types-section are now the default. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186835 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/common.opt | 8 ++++---- gcc/config/darwin.c | 4 +++- gcc/config/vxworks.c | 6 +++--- gcc/doc/invoke.texi | 17 ++++++++++------- gcc/toplev.c | 9 --------- 6 files changed, 36 insertions(+), 24 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51fefab..f51ccbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2012-04-25 Jakub Jelinek + + * common.opt (flag_debug_types_section): Default to 0. + (dwarf_version): Default to 4. + (dwarf_record_gcc_switches): Default to 1. + (dwarf_strict): Default to 0. + * toplev.c (process_options): Don't handle dwarf_strict + or dwarf_version here. + * config/vxworks.c (vxworks_override_options): Don't + test whether dwarf_strict or dwarf_version are negative, + instead test !global_options_set.x_dwarf_*. + * config/darwin.c (darwin_override_options): Default to + dwarf_version 2. + * doc/invoke.texi: Note that -gdwarf-4, -grecord-gcc-switches + and -fno-debug-types-section are now the default. + 2012-04-25 Jan Hubicka * cgraphunit.c: Update toplevel comment. diff --git a/gcc/common.opt b/gcc/common.opt index df94227..4a2508c7 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -967,7 +967,7 @@ 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) +Common Report Var(flag_debug_types_section) Init(0) Output .debug_types section when using DWARF v4 debuginfo. ; Nonzero for -fdefer-pop: don't pop args after each function call @@ -2212,7 +2212,7 @@ Common JoinedOrMissing Negative(gdwarf-) Generate debug information in COFF format gdwarf- -Common Joined UInteger Var(dwarf_version) Init(-1) Negative(gstabs) +Common Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs) Generate debug information in DWARF v2 (or later) format ggdb @@ -2220,7 +2220,7 @@ Common JoinedOrMissing Generate debug information in default extended format gno-record-gcc-switches -Common RejectNegative Var(dwarf_record_gcc_switches,0) Init(0) +Common RejectNegative Var(dwarf_record_gcc_switches,0) Init(1) Don't record gcc command line switches in DWARF DW_AT_producer. grecord-gcc-switches @@ -2236,7 +2236,7 @@ Common JoinedOrMissing Negative(gvms) Generate debug information in extended STABS format gno-strict-dwarf -Common RejectNegative Var(dwarf_strict,0) Init(-1) +Common RejectNegative Var(dwarf_strict,0) Init(0) Emit DWARF additions beyond selected version gstrict-dwarf diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index ba253dd..15efaa3 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1,6 +1,6 @@ /* Functions for generic Darwin as target machine for GNU C compiler. Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -2973,6 +2973,8 @@ darwin_override_options (void) workaround for tool bugs. */ if (!global_options_set.x_dwarf_strict) dwarf_strict = 1; + if (!global_options_set.x_dwarf_version) + dwarf_version = 2; /* Do not allow unwind tables to be generated by default for m32. fnon-call-exceptions will override this, regardless of what we do. */ diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c index 1e5a7ad..d88f03f 100644 --- a/gcc/config/vxworks.c +++ b/gcc/config/vxworks.c @@ -1,5 +1,5 @@ /* Common VxWorks target definitions for GNU compiler. - Copyright (C) 2007, 2008, 2010 + Copyright (C) 2007, 2008, 2010, 2012 Free Software Foundation, Inc. Contributed by CodeSourcery, Inc. @@ -147,9 +147,9 @@ vxworks_override_options (void) /* Default to strict dwarf-2 to prevent potential difficulties observed with non-gdb debuggers on extensions > 2. */ - if (dwarf_strict < 0) + if (!global_options_set.x_dwarf_strict) dwarf_strict = 1; - if (dwarf_version < 0) + if (!global_options_set.x_dwarf_version) dwarf_version = 2; } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8ca2f4e..c6bf20d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4781,14 +4781,16 @@ normally emits debugging information for classes because using this option increases the size of debugging information by as much as a factor of two. -@item -fno-debug-types-section -@opindex fno-debug-types-section +@item -fdebug-types-section @opindex fdebug-types-section -By default when using DWARF Version 4 or higher, type DIEs are put into +@opindex fno-debug-types-section +When using DWARF Version 4 or higher, type DIEs can be put into their own @code{.debug_types} section instead of making them part of the @code{.debug_info} section. It is more efficient to put them in a separate comdat sections since the linker can then remove duplicates. -But not all DWARF consumers support @code{.debug_types} sections yet. +But not all DWARF consumers support @code{.debug_types} sections yet +and on some objects @code{.debug_types} produces larger instead of smaller +debugging information. @item -gstabs+ @opindex gstabs+ @@ -4819,7 +4821,8 @@ assembler (GAS) to fail with an error. @item -gdwarf-@var{version} @opindex gdwarf-@var{version} Produce debugging information in DWARF format (if that is supported). -The value of @var{version} may be either 2, 3 or 4; the default version is 2. +The value of @var{version} may be either 2, 3 or 4; the default version +for most targets is 4. Note that with DWARF Version 2, some ports require and always use some non-conflicting DWARF 3 extensions in the unwind tables. @@ -4834,12 +4837,12 @@ compiler that may affect code generation to be appended to the DW_AT_producer attribute in DWARF debugging information. The options are concatenated with spaces separating them from each other and from the compiler version. See also @option{-frecord-gcc-switches} for another -way of storing compiler options into the object file. +way of storing compiler options into the object file. This is the default. @item -gno-record-gcc-switches @opindex gno-record-gcc-switches Disallow appending command-line options to the DW_AT_producer attribute -in DWARF debugging information. This is the default. +in DWARF debugging information. @item -gstrict-dwarf @opindex gstrict-dwarf diff --git a/gcc/toplev.c b/gcc/toplev.c index fcfdba2..53590b0 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1375,15 +1375,6 @@ process_options (void) } } - /* Unless over-ridden for the target, assume that all DWARF levels - may be emitted, if DWARF2_DEBUG is selected. */ - if (dwarf_strict < 0) - dwarf_strict = 0; - - /* And select a default dwarf level. */ - if (dwarf_version < 0) - dwarf_version = 2; - /* A lot of code assumes write_symbols == NO_DEBUG if the debugging level is 0. */ if (debug_info_level == DINFO_LEVEL_NONE) -- 2.7.4