Fix PR threads/19422 - show which thread caused stop
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.java / jnpe.exp
CommitLineData
618f726f 1# Copyright 2009-2016 Free Software Foundation, Inc.
186c406b
TT
2
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.
7#
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.
12#
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/>.
15
186c406b
TT
16load_lib "java.exp"
17
c24ccbce
TT
18standard_testfile .java
19if { [compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != "" } {
bd1dce5f 20 untested "Couldn't compile $subdir/${srcfile}"
186c406b
TT
21 return -1
22}
23
24# Start with a fresh gdb.
25
26clean_restart $testfile
27
28set line [gdb_get_line_number "break here" $testfile.java]
29if ![runto "$testfile.java:$line"] then {
30 perror "couldn't run to jnpe.main"
31 continue
32}
33
b4893d48 34if {![skip_unwinder_tests]} {
186c406b
TT
35 unsupported "jnpe.exp could not find _Unwind_DebugHook"
36 return -1
37}
38
39gdb_test "handle SIGSEGV nostop noprint" \
40 "SIGSEGV.*fault" \
41 "disable SIGSEGV for next-over-NPE"
42
43# The line where we stop differs according to gcj; just check that we
44# did not already execute the catch point. This is done in a somewhat
45# funny way due to other gcj debuginfo oddities that don't
46# meaningfully affect the user's experience.
47
48gdb_test "next" \
49 ".*" \
50 "next over NPE"
51
52set line [gdb_get_line_number "stop point"]
53gdb_breakpoint $line
f303dbd6 54gdb_test "continue" "Continuing.\[\r\n\]*success\[\r\n\]*Thread .* hit Breakpoint .*:$line\[\r\n\]*.*// stop point\[\r\n\]*" \
186c406b 55 "continue to success for next-over-NPE"
This page took 1.593188 seconds and 4 git commands to generate.