public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-pmuldoon-next-over-throw: Fix fuzzy results on gdb.java/jnpe.exp
@ 2009-11-26 18:26 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-11-26 18:26 UTC (permalink / raw)
  To: archer-commits

The branch, archer-pmuldoon-next-over-throw has been updated
       via  608e0e8e342f34495ca13e6723f3d6903becaa85 (commit)
      from  dceaa4d762098173f0348f0facbc234f7e7a5e79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 608e0e8e342f34495ca13e6723f3d6903becaa85
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Nov 26 19:25:48 2009 +0100

    Fix fuzzy results on gdb.java/jnpe.exp
    
    gdb/testsuite/
    2009-11-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.java/jnpe.java (main): New comment.
    	* gdb.java/jnpe.exp: Make $srcfile a basename.
    	(run java next-over-throw): Expect a source comment.
    	(check for unwinder hook in java): Expect also no trailing dot.  Call
    	setup_xfail, turn pass into xfail.
    	(next over NPE): Do not expect anything.  Update comment.
    	(catch point): New.
    
    --- ./gdb/testsuite/gdb.java/jnpe.java	2009-09-09 18:39:49.000000000 +0200
    +++ ./gdb/testsuite/gdb.java/jnpe.java	2009-11-26 19:06:19.000000000 +0100
    @@ -32,7 +32,7 @@ public class jnpe
           }
         catch (NullPointerException n)
           {
    -	System.out.println ("success");
    +	System.out.println ("success"); // catch point
           }
       }
     }
    --- ./gdb/testsuite/gdb.java/jnpe.exp	2009-09-09 18:39:49.000000000 +0200
    +++ ./gdb/testsuite/gdb.java/jnpe.exp	2009-11-26 19:13:10.000000000 +0100
    @@ -20,10 +20,10 @@ if $tracelevel then {
     load_lib "java.exp"
    
     set testfile "jnpe"
    -set srcfile ${srcdir}/$subdir/${testfile}.java
    +set srcfile ${testfile}.java
     set binfile ${objdir}/${subdir}/${testfile}
    -if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
    -    untested "Couldn't compile ${srcfile}"
    +if  { [compile_java_from_source ${srcdir}/$subdir/${srcfile} ${binfile} "-g"] != "" } {
    +    untested "Couldn't compile ${srcdir}/$subdir/${srcfile}"
         return -1
     }
    
    @@ -41,7 +41,7 @@ set line [gdb_get_line_number "break her
     gdb_test "break $testfile.java:$line" ""
    
     gdb_test "run" \
    -  "Current language.*java" \
    +  "// break here.*" \
       "run java next-over-throw"
    
     # See whether we have the needed unwinder hooks.
    @@ -50,9 +50,10 @@ gdb_test_multiple "print _Unwind_DebugHo
         -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
     	pass "check for unwinder hook in java"
         }
    -    -re "No symbol .* in current context.\r\n$gdb_prompt $" {
    +    -re "No symbol .* in current context.?\r\n$gdb_prompt $" {
     	# Pass the test so we don't get bogus fails in the results.
    -	pass "check for unwinder hook in java"
    +	setup_xfail *-*-*
    +	fail "check for unwinder hook in java"
     	set ok 0
         }
     }
    @@ -65,8 +66,12 @@ gdb_test "handle SIGSEGV nostop noprint"
       "SIGSEGV.*fault" \
       "disable SIGSEGV for next-over-NPE"
    
    -# We sometimes stop at line 37, not line 35.  This seems to be a gcj
    -# oddity -- another next will solve it.
    +# The line where we stop differ according to gcj; check just we did not already
    +# execute the catch point.
    +
     gdb_test "next" \
    -  "3\[57\].*" \
    +  "" \
       "next over NPE"
    +
    +gdb_breakpoint [gdb_get_line_number "catch point"]
    +gdb_continue_to_breakpoint "catch point" ".*// catch point.*"

-----------------------------------------------------------------------

Summary of changes:
 gdb/testsuite/gdb.java/jnpe.exp  |   23 ++++++++++++++---------
 gdb/testsuite/gdb.java/jnpe.java |    2 +-
 2 files changed, 15 insertions(+), 10 deletions(-)

First 500 lines of diff:
diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp
index 74d4d58..e71391e 100644
--- a/gdb/testsuite/gdb.java/jnpe.exp
+++ b/gdb/testsuite/gdb.java/jnpe.exp
@@ -20,10 +20,10 @@ if $tracelevel then {
 load_lib "java.exp"
 
 set testfile "jnpe"
-set srcfile ${srcdir}/$subdir/${testfile}.java
+set srcfile ${testfile}.java
 set binfile ${objdir}/${subdir}/${testfile}
-if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
-    untested "Couldn't compile ${srcfile}"
+if  { [compile_java_from_source ${srcdir}/$subdir/${srcfile} ${binfile} "-g"] != "" } {
+    untested "Couldn't compile ${srcdir}/$subdir/${srcfile}"
     return -1
 }
 
@@ -41,7 +41,7 @@ set line [gdb_get_line_number "break here" $testfile.java]
 gdb_test "break $testfile.java:$line" ""
 
 gdb_test "run" \
-  "Current language.*java" \
+  "// break here.*" \
   "run java next-over-throw"
 
 # See whether we have the needed unwinder hooks.
@@ -50,9 +50,10 @@ gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" {
     -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
 	pass "check for unwinder hook in java"
     }
-    -re "No symbol .* in current context.\r\n$gdb_prompt $" {
+    -re "No symbol .* in current context.?\r\n$gdb_prompt $" {
 	# Pass the test so we don't get bogus fails in the results.
-	pass "check for unwinder hook in java"
+	setup_xfail *-*-*
+	fail "check for unwinder hook in java"
 	set ok 0
     }
 }
@@ -65,8 +66,12 @@ gdb_test "handle SIGSEGV nostop noprint" \
   "SIGSEGV.*fault" \
   "disable SIGSEGV for next-over-NPE"
 
-# We sometimes stop at line 37, not line 35.  This seems to be a gcj
-# oddity -- another next will solve it.
+# The line where we stop differ according to gcj; check just we did not already
+# execute the catch point.
+
 gdb_test "next" \
-  "3\[57\].*" \
+  "" \
   "next over NPE"
+
+gdb_breakpoint [gdb_get_line_number "catch point"]
+gdb_continue_to_breakpoint "catch point" ".*// catch point.*"
diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java
index ffca3ab..3524830 100644
--- a/gdb/testsuite/gdb.java/jnpe.java
+++ b/gdb/testsuite/gdb.java/jnpe.java
@@ -32,7 +32,7 @@ public class jnpe
       }
     catch (NullPointerException n)
       {
-	System.out.println ("success");
+	System.out.println ("success"); // catch point
       }
   }
 }


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-26 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-26 18:26 [SCM] archer-pmuldoon-next-over-throw: Fix fuzzy results on gdb.java/jnpe.exp jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).