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 debug.exp failures


On Fri, Jun 12, 2009 at 06:38:20PM +0200, Hans-Peter Nilsson wrote:
> > Date: Tue, 09 Jun 2009 00:06:20 -0700
> > From: Richard Henderson <rth@redhat.com>
> 
> > There is one quirk.  Previously we'd accept options like -gdwarf-23
> > and take that to mean dwarf2 debugging, verbosity level 3.  Now
> > you *must* write this as -gdwarf-2 -g3.
> 
> A -gdwarf-21 is currently not the same as -gdwarf-2 -g1, as a
> regtest of e.g. r148404 (before your change) together with
> <http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00962.html> will
> show.  For example just C:

That's because -gdwarf-2 -g1 as separate option no longer matches the
"*1" check on the first argument.
This patch works for me.  Note that I'm not using -gstabs -g3 etc.,
because unlike -gdwarf-2 where the separate option make no difference,
-gstabs3 and -gstabs -g3 as I read opts.c might be different (the difference
is in use_gnu_debug_info_extensions, -gstabs3 sets it to 0, while
-gstabs -g3 sets it to DEFAULT_GDB_EXTENSIONS.

2009-06-12  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/40426
	* lib/gcc-dg.exp (gcc-dg-debug-runtest): For type -gdwarf-2 and
	level != "" use separate -gdwarf-2 -g${level} options instead of
	-gdwarf-2${level}.
	* lib/gfortran-dg.exp (gfortran-dg-debug-runtest): Likewise.
	* gfortran.dg/debug/pr37738.f: Also skip if -gdwarf-2 -g1.
	* gfortran.dg/debug/pr35154-dwarf2.f: Likewise.

--- gcc/testsuite/lib/gcc-dg.exp.jj	2009-06-08 11:53:50.000000000 +0200
+++ gcc/testsuite/lib/gcc-dg.exp	2009-06-12 19:50:26.000000000 +0200
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008
+#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -289,10 +289,18 @@ proc gcc-dg-debug-runtest { target_compi
 		    $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 \
-				[list "${type}${level}" "$opt" ]
+		    if { ($type == "-gdwarf-2") && ($level != "") } {
+			lappend DEBUG_TORTURE_OPTIONS [list "${type}" "-g${level}"]
+			foreach opt $opt_opts {
+			    lappend DEBUG_TORTURE_OPTIONS \
+				    [list "${type}" "-g${level}" "$opt" ]
+			}
+		    } else {
+			lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
+			foreach opt $opt_opts {
+			    lappend DEBUG_TORTURE_OPTIONS \
+				    [list "${type}${level}" "$opt" ]
+			}
 		    }
 		}
 	    }
@@ -320,7 +328,8 @@ proc gcc-dg-debug-runtest { target_compi
 	    if { ([string match {*/debug-[126].c} "$nshort"] \
 		   || [string match {*/enum-1.c} "$nshort"] \
 		   || [string match {*/enum-[12].C} "$nshort"]) \
-		    && [string match "*1" [lindex "$flags" 0] ] } {
+		    && ([string match "*1" [lindex "$flags" 0] ]
+			|| [lindex "$flags" 1] == "-g1") } {
 		set doit 0
 	    }
 
--- gcc/testsuite/lib/gfortran-dg.exp.jj	2008-10-23 13:21:06.000000000 +0200
+++ gcc/testsuite/lib/gfortran-dg.exp	2009-06-12 19:55:35.000000000 +0200
@@ -135,10 +135,18 @@ proc gfortran-dg-debug-runtest { target_
            }
            remove-build-file "trivial.S"
            foreach level {1 "" 3} {
-               lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
-               foreach opt $opt_opts {
-                   lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}" \
-                      "$opt" ]
+	       if { ($type == "-gdwarf-2") && ($level != "") } {
+		   lappend DEBUG_TORTURE_OPTIONS [list "${type}" "-g${level}"]
+		   foreach opt $opt_opts {
+		       lappend DEBUG_TORTURE_OPTIONS \
+			       [list "${type}" "-g${level}" "$opt" ]
+		   }
+	       } else {
+		   lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
+		   foreach opt $opt_opts {
+		       lappend DEBUG_TORTURE_OPTIONS \
+			       [list "${type}${level}" "$opt" ]
+		   }
                }
            }
        }
--- gcc/testsuite/gfortran.dg/debug/pr37738.f.jj	2008-10-23 13:21:07.000000000 +0200
+++ gcc/testsuite/gfortran.dg/debug/pr37738.f	2009-06-12 20:01:18.000000000 +0200
@@ -1,6 +1,7 @@
 C PR debug/37738
 C { dg-do compile }
 C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
 C { dg-options "-dA" }
 
       subroutine a
--- gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f.jj	2008-10-23 13:21:07.000000000 +0200
+++ gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f	2009-06-12 20:00:27.000000000 +0200
@@ -1,6 +1,7 @@
 C     Test program for common block debugging.  G. Helffrich 11 July 2004.
 C { dg-do compile }
 C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "-g1" } { "" } }
 C { dg-options "-dA" }
       common i,j
       common /label/l,m


	Jakub


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