-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004, 2006 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
if ![set_lang_java] then {
# Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main".
# As of 2004-02-24 it wasn't working and is being tested separatly.
- runto "\'${testfile}.main(java.lang.String\[\])\'"
+ # Before GCJ 4.1 (approximately) the demangled name did not include
+ # a method signature; after that point it does include a trailing
+ # signature.
+ runto_main
+ set function "${testfile}.main(java.lang.String\[\])"
+ gdb_breakpoint "\'$function\'" { allow-pending }
+ gdb_breakpoint "\'${function}void\'" { allow-pending }
+ gdb_continue_to_breakpoint $function
gdb_test "p jvclass.addprint(4,5,6)" "sum is 15\r\n.*" "unambiguous static call"