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]

[PATCH] Fix recent -gdwarf-2 failures


Richard Henderson's change on June 11th breaks the testsuite for targets
supporting -gdwarf-2, since gcc-dg.exp tries to create -gdwarf-21 and
-gdwarf-23 options, which are now flagged as illegal.  This patch prevents the
testsuite from adding the debug level option to -gdwarf-2, but it does add it
to the other options.  I did try to make the code pass -gdwarf-2 -g1 as
suggested by Richard in the patch, but several of the tests fail.  If we want
to support setting the debug level, we either need to fix the compiler so that
-gdwarf-2 -g1 works, or we need to add another option, such as -gdebug-level=1.

Is this patch ok for the mainline?

2009-06-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* lib/gcc-dg.exp (gcc-dg-debug-runtest): Gcc doesn't support
	providing a debug level after -gdwarf-2.

Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 148475)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -288,11 +288,19 @@ proc gcc-dg-debug-runtest { target_compi
 	    if { ! [string match "*: target system does not support the * debug format*" \
 		    $comp_output] } {
 		remove-build-file "trivial.S"
-		foreach level {1 "" 3} {
-		    lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
-		    foreach opt $opt_opts {
-			lappend DEBUG_TORTURE_OPTIONS \
+		lappend DEBUG_TORTURE_OPTIONS [list "${type}"]
+		foreach opt $opt_opts {
+		    lappend DEBUG_TORTURE_OPTIONS [list "${type}" "$opt" ]
+		}
+
+		# -gdwarf-2 does not take a debug level.
+		if { $type != "-gdwarf-2" } {
+		    foreach level {1 3} {
+			lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
+			foreach opt $opt_opts {
+			    lappend DEBUG_TORTURE_OPTIONS \
 				[list "${type}${level}" "$opt" ]
+			}
 		    }
 		}
 	    }


-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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