1 # Copyright 2009, 2010 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 set srcfile ${testfile}.java
24 set binfile ${objdir}/${subdir}/${testfile}
25 if { [compile_java_from_source ${srcdir}/$subdir/${srcfile} ${binfile} "-g"] != "" } {
26 untested "Couldn't compile ${srcdir}/$subdir/${srcfile}"
30 # Start with a fresh gdb.
32 clean_restart $testfile
34 set line [gdb_get_line_number "break here" $testfile.java]
35 if ![runto "$testfile.java:$line"] then {
36 perror "couldn't run to jnpe.main"
40 # See whether we have the needed unwinder hooks.
42 gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" {
43 -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
44 pass "check for unwinder hook in java"
46 -re "No symbol .* in current context.?\r\n$gdb_prompt $" {
47 # Pass the test so we don't get bogus fails in the results.
49 fail "check for unwinder hook in java"
54 unsupported "jnpe.exp could not find _Unwind_DebugHook"
58 gdb_test "handle SIGSEGV nostop noprint" \
60 "disable SIGSEGV for next-over-NPE"
62 # The line where we stop differs according to gcj; just check that we
63 # did not already execute the catch point. This is done in a somewhat
64 # funny way due to other gcj debuginfo oddities that don't
65 # meaningfully affect the user's experience.
71 set line [gdb_get_line_number "stop point"]
73 gdb_test "continue" "Continuing.\[\r\n\]*success\[\r\n\]*Breakpoint .*:$line\[\r\n\]*.*// stop point\[\r\n\]*" \
74 "continue to success for next-over-NPE"