This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vta] enable -g with -gtoggle


If no -g or -g<number> option is present, write_symbols ends up as
NO_DEBUG.  This means -gtoggle doesn't quite work if there isn't any
other debug info option.  This patch fixes it, so that -gtoggle, by
itself (i.e., without any other -g option) is equivalent to -g.

I'm checking this in as obvious.

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* toplev.c (process_options): Choose default debugging type when
	gtoggle enables debug info and type is unset.

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c.orig	2009-09-04 15:05:56.000000000 -0300
+++ gcc/toplev.c	2009-09-04 15:07:27.000000000 -0300
@@ -1883,7 +1883,12 @@ process_options (void)
   if (flag_gtoggle)
     {
       if (debug_info_level == DINFO_LEVEL_NONE)
-	debug_info_level = DINFO_LEVEL_NORMAL;
+	{
+	  debug_info_level = DINFO_LEVEL_NORMAL;
+
+	  if (write_symbols == NO_DEBUG)
+	    write_symbols = PREFERRED_DEBUGGING_TYPE;
+	}
       else
 	debug_info_level = DINFO_LEVEL_NONE;
     }
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]