PATCH: Support stabs in libjava test

H . J . Lu hjl@lucon.org
Sun Jun 9 10:00:00 GMT 2002


When stabs is used, I get

/tmp/ccgCe9gi.s: Assembler messages:^M
/tmp/ccgCe9gi.s:29: Warning: .stabs: description field 'a0004' too big, try a
different debug format^M
/tmp/ccgCe9gi.s:263: Warning: .stabs: description field '10001' too big, try a
different debug format^M

and the test is marked "FAIL". I am enclosing a patch to filter it out.
The interesting results on Linux/x86 are:

1. DWARF 2:

                === libjava Summary ===

# of expected passes            2073
# of unexpected failures        1
# of expected failures          18
# of untested testcases         15

output is:
/tmp/ccMCVWbf.o(.data+0x64): undefined reference to `support::Waldo::class$'^M

2. stabs


                === libjava Summary ===

# of expected passes            2075
# of unexpected successes       4
# of expected failures          14
# of untested testcases         6
XPASS: Where compilation from source
XPASS: Where -O compilation from source
XPASS: inner_1 compilation from source
XPASS: inner_1 -O compilation from source

One example:
/tmp/ccO3Lvkg.s: Assembler messages:^M
/tmp/ccO3Lvkg.s:26: Warning: .stabs: description field '90006' too big, try a
different debug format^M
/tmp/ccO3Lvkg.s:53: Warning: .stabs: description field '10001' too big, try a
different debug format^M
/tmp/ccR3ol5j.o: In function `Where::Where[in-charge]()':^M
/home/hjl/work/gnu/src/gcc-3.1/gcc/libjava/testsuite/libjava.compile/Where.java:1:
undefined reference to `support::Waldo::class$'^M
collect2: ld returned 1 exit status^M

It looks like some area of dwarf support in gcc/ld is not as good as
stabs. Shouldn't we fix gcc/ld for that?


H.J.
-------------- next part --------------
2002-06-09  H.J. Lu  (hjl@gnu.org)

	* lib/prune.exp: New. Prune stabs assembler message.
	* lib/libjava.exp: Load "prune.exp".

	* lib/libjava.exp: Replace prune_warnings with
	prune_libjava_output.
	* libjava.jni/jni.exp: Likewise.
	* libjava.mauve/mauve.exp: Likewise.

--- libjava/testsuite/lib/libjava.exp.prune	Sun May 19 21:51:07 2002
+++ libjava/testsuite/lib/libjava.exp	Sun Jun  9 08:39:28 2002
@@ -1,6 +1,7 @@
 # Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
 
 load_lib "libgloss.exp"
+load_lib "prune.exp"
 
 # GCJ_UNDER_TEST is the compiler under test.
 
@@ -398,7 +399,7 @@ proc gcj_link {program main files {optio
 	eval lappend arguments $options
     }
     lappend arguments "additional_flags=--main=$main"
-    set x [prune_warnings [libjava_tcompile $files $program executable \
+    set x [prune_libjava_output [libjava_tcompile $files $program executable \
 			     $arguments]]
     if {$x != ""} {
 	verbose "link failure: $x" 2
@@ -475,7 +476,7 @@ proc test_libjava_from_source { options 
 
     set removeList [list $executable]
 
-    set x [prune_warnings \
+    set x [prune_libjava_output \
 	     [libjava_tcompile $srcfile "$executable" $target $args]]
     if {[info exists opts(xfail-gcj)]} {
 	setup_xfail *-*-*
@@ -645,11 +646,11 @@ proc test_libjava_from_javac { options s
     set jvscan [find_jvscan]
     verbose "jvscan is $jvscan"
     set main_name [string trim \
-		     [prune_warnings \
+		     [prune_libjava_output \
 			[lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]]
     verbose "main name is $main_name"
     set class_out [string trim \
-		     [prune_warnings \
+		     [prune_libjava_output \
 			[lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]]
     verbose "class list is $class_out"
 
@@ -714,7 +715,7 @@ proc test_libjava_from_javac { options s
     if {$mode == "compile"} {
 	foreach c_file $class_files {
 	    set executable [file rootname [file tail $c_file]].o
-	    set x [prune_warnings \
+	    set x [prune_libjava_output \
 		     [libjava_tcompile $c_file "$executable" $type $args]]
 	    lappend removeList $executable
 	    if {$x != ""} {
@@ -730,7 +731,7 @@ proc test_libjava_from_javac { options s
 	    set hack "$hack $stupid"
 	}
 	lappend removeList $executable
-	set x [prune_warnings \
+	set x [prune_libjava_output \
 		 [libjava_tcompile $hack "$executable" $type $args]]
     }
     if {[info exists opts(xfail-byte)]} {
--- libjava/testsuite/lib/prune.exp.prune	Sun Jun  9 09:30:59 2002
+++ libjava/testsuite/lib/prune.exp	Sun Jun  9 09:29:49 2002
@@ -0,0 +1,33 @@
+#   Copyright (C) 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# Prune messages from gcc that aren't useful.
+
+proc prune_libjava_output { text } {
+    #send_user "Before:$text\n"
+
+    if { [info procs prune_warnings] != "" } then {
+	set text [prune_warnings $text]
+    }
+
+    # Ignore stabs assembler warnings.
+    regsub -all "(^|\n)\[^\n\]*Assembler messages:.*" $text "" text
+    regsub -all "(^|\n)\[^\n\]*: Warning: .stabs: description field \[^\n\]*" $text "" text
+
+    #send_user "After:$text\n"
+
+    return $text
+}
--- libjava/testsuite/libjava.jni/jni.exp.prune	Fri Apr  5 23:28:21 2002
+++ libjava/testsuite/libjava.jni/jni.exp	Sun Jun  9 08:39:54 2002
@@ -15,7 +15,7 @@ proc gcj_jni_compile_c_to_so {file {opti
   # Find jni.h.
   lappend options "additional_flags=-I$srcdir/../include"
 
-  set x [prune_warnings [target_compile $file $soname executable $options]]
+  set x [prune_libjava_output [target_compile $file $soname executable $options]]
   if {$x != ""} {
     verbose "target_compile failed: $x" 2
     fail "$name.c compilation"
@@ -30,7 +30,7 @@ proc gcj_jni_compile_c_to_so {file {opti
 proc gcj_jni_build_header {file} {
   set gcjh [find_gcjh]
   set file [file rootname $file]
-  set x [string trim [prune_warnings \
+  set x [string trim [prune_libjava_output \
 			[lindex [local_exec "$gcjh -jni $file" "" "" 300] 1]]]
   if {$x != ""} {
     verbose "local_exec failed: $x" 2
--- libjava/testsuite/libjava.mauve/mauve.exp.prune	Mon Apr  8 12:10:00 2002
+++ libjava/testsuite/libjava.mauve/mauve.exp	Sun Jun  9 08:40:07 2002
@@ -139,7 +139,7 @@ proc test_mauve {} {
   foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} {
     set file $base.class
     set obj $base.o
-    set x [prune_warnings \
+    set x [prune_libjava_output \
 	     [target_compile [pwd]/$file $obj object $compile_args]]
     if {$x != ""} then {
       fail "Compile $obj"
@@ -165,7 +165,7 @@ proc test_mauve {} {
       if {! [file exists $obj]} then {
 	verbose "compiling $obj for test of $class"
 	set srcfile [file rootname $obj].class
-	set x [prune_warnings \
+	set x [prune_libjava_output \
 		 [target_compile [pwd]/$srcfile $obj object $compile_args]]
 	if {$x != ""} then {
 	  fail "Compile $obj for $class"
@@ -180,7 +180,7 @@ proc test_mauve {} {
       continue
     }
 
-    set x [prune_warnings [target_compile [concat $uses($file) $objlist] \
+    set x [prune_libjava_output [target_compile [concat $uses($file) $objlist] \
 			     $Executable executable $link_args]]
     if {$x != ""} then {
       set proc_ok 0
@@ -277,7 +277,7 @@ proc test_mauve_sim {} {
 		  gnu/testlet/config} {
     set file $base.class
     set obj $base.o
-    set x [prune_warnings \
+    set x [prune_libjava_output \
 	     [target_compile [pwd]/$file $obj object $compile_args]]
     if {$x != ""} then {
       fail "Compile $obj"
@@ -306,7 +306,7 @@ proc test_mauve_sim {} {
       if {! [file exists $obj]} then {
 	verbose "compiling $obj for test of $class"
 	set srcfile [file rootname $obj].class
-	set x [prune_warnings \
+	set x [prune_libjava_output \
 		 [target_compile [pwd]/$srcfile $obj object $compile_args]]
 	if {$x != ""} then {
 	  fail "Compile $obj for $class"
@@ -342,7 +342,7 @@ proc test_mauve_sim {} {
 	return 0
     }
 
-    set x [prune_warnings \
+    set x [prune_libjava_output \
 	     [target_compile gnu/testlet/DejaGNUTestHarness.class \
 		gnu/testlet/DejaGNUTestHarness.o object $compile_args]]
     if {$x != ""} then {
@@ -351,7 +351,7 @@ proc test_mauve_sim {} {
 	continue
     }
 
-    set x [prune_warnings [target_compile [concat $uses($file) $objlist] \
+    set x [prune_libjava_output [target_compile [concat $uses($file) $objlist] \
 			     $Executable executable $link_args]]
     if {$x != ""} then {
       set proc_ok 0


More information about the Binutils mailing list