* gdb.java/jmain.exp: Handle demangled names with and without method
authorDaniel Jacobowitz <drow@false.org>
Sun, 29 Apr 2007 17:13:57 +0000 (17:13 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sun, 29 Apr 2007 17:13:57 +0000 (17:13 +0000)
signatures.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.java/jmain.exp

index bc8b6cea1cd46c6dd22020340ed6a5cde190294f..c4b7e688dc4df4ca1c3d1cdec56bb0ad5b966b43 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-29  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.java/jmain.exp: Handle demangled names with and without method
+       signatures.
+
 2007-04-29  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.mi/mi-syn-frame.c (main, foo, bar)
index 79cb1dd1f3d1f8090e507f4c7fcf12221722132d..d48686612f599d5a09598a9cb1862bb6d80d2881 100644 (file)
@@ -50,18 +50,46 @@ gdb_test "set print sevenbit-strings" ".*"
 
 set bpmain "Breakpoint .* file .*jmain.java, line 5\."
 
+# Where GCC PR 16439 puts the breakpoint.
+set earlybpmain "Breakpoint .* file .*jmain.java, line 4\."
+
 gdb_load "${binfile}"
 setup_kfail *-*-* java/1567
 gdb_test "break main" "${bpmain}"
 
 # Check that an unqualified "main" works.
 
-
 gdb_load "${binfile}"
 setup_kfail *-*-* java/1565
 gdb_test "break jmain.main" "${bpmain}"
 
 # Check that a fully qualified "main" works.
 gdb_load "${binfile}"
-setup_xfail *-*-* gcc/16439
-gdb_test "break \'${testfile}.main(java.lang.String\[\])\'" "${bpmain}"
+set cmd "break \'${testfile}.main(java.lang.String\[\])\'"
+set msg $cmd
+gdb_test_multiple $cmd $msg {
+    -re "${bpmain}\r\n$gdb_prompt $" {
+       pass $msg
+    }
+    -re "${earlybpmain}\r\n$gdb_prompt $" {
+       setup_xfail *-*-* gcc/16439
+       fail $msg
+    }
+    -re "Make breakpoint pending.* \\(y or \\\[n\\\]\\) $" {
+       gdb_test "n" "" ""
+
+       # Check again with a method signature at the end.
+       set cmd "break \'${testfile}.main(java.lang.String\[\])void\'"
+       set msg $cmd
+       gdb_test_multiple $cmd $msg {
+           -re "${bpmain}\r\n$gdb_prompt $" {
+               pass $msg
+           }
+           -re "${earlybpmain}\r\n$gdb_prompt $" {
+               setup_xfail *-*-* gcc/16439
+               fail $msg
+           }
+       }
+    }
+}
+