Fix PR gdb/844
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / killed.exp
CommitLineData
dc62bfc2 1# Copyright 2002, 2003 Free Software Foundation, Inc.
38fc42c8
JB
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 2 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, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@gnu.org
19
20# This is a regression test for gdb/568 in the sources.redhat.com
21# GNATS database. As of early June 2002, GDB could get sort of wedged
22# debugging the program `killed.c':
23#
24# $ $D6/gdb/gdb -nw killed
25# GNU gdb 2002-06-11-cvs
26# Copyright 2002 Free Software Foundation, Inc.
27# GDB is free software, covered by the GNU General Public License, and you are
28# welcome to change it and/or distribute copies of it under certain conditions.
29# Type "show copying" to see the conditions.
30# There is absolutely no warranty for GDB. Type "show warranty" for details.
31# This GDB was configured as "i686-pc-linux-gnu"...
32# (gdb) run
33# Starting program: /home/jimb/foo/play/killed
34# [New Thread 1024 (LWP 6487)]
35# [New Thread 2049 (LWP 6488)]
36# [New Thread 1026 (LWP 6489)]
37# Cannot find user-level thread for LWP 6487: generic error
38# (gdb) quit
39# The program is running. Exit anyway? (y or n) y
40# Cannot find thread 2049: generic error
41# (gdb) kill
42# Kill the program being debugged? (y or n) y
43# Cannot find thread 2049: generic error
44# (gdb) The program is running. Exit anyway? (y or n) y
45# Cannot find thread 2049: generic error
46# (gdb)
47# [7]+ Stopped $D6/gdb/gdb -nw killed
48# $ kill %7
49#
50# [7]+ Stopped $D6/gdb/gdb -nw killed
51# $ kill -9 %7
52#
53# [7]+ Stopped $D6/gdb/gdb -nw killed
54# $
55# [7]+ Killed $D6/gdb/gdb -nw killed
56# $
57
58if $tracelevel then {
59 strace $tracelevel
60}
61
62set prms_id 0
63set bug_id 0
64
65set testfile "killed"
66set srcfile ${testfile}.c
67set binfile ${objdir}/${subdir}/${testfile}
68
dc62bfc2 69if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
b5ab8ff3 70 return -1
38fc42c8
JB
71}
72
73
74gdb_start
75gdb_reinitialize_dir $srcdir/$subdir
76gdb_load ${binfile}
77
78gdb_test "run" "" "run program to completion"
79
80# Try to quit.
81send_gdb "quit\n"
82gdb_expect {
83 -re "The program is running. Exit anyway\\? \\(y or n\\) $" {
84 send_gdb "y\n"
85 exp_continue
86 }
87 eof {
88 pass "GDB exits after multi-threaded program exits messily"
89 }
90 -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
91 # setup_kfail "gdb/568"
2f71430b 92 fail "GDB exits after multi-threaded program exits messily (not a regression; gdb/568)"
38fc42c8
JB
93 }
94 timeout {
95 fail "GDB exits after multi-threaded program exits messily (timeout)"
96 }
97}
This page took 0.061762 seconds and 4 git commands to generate.