Commit | Line | Data |
---|---|---|
ecd75fc8 | 1 | # Copyright 2002-2014 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 | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
38fc42c8 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
38fc42c8 JB |
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. | |
e22f8b7c | 12 | # |
38fc42c8 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
38fc42c8 JB |
15 | |
16 | # Please email any bugs, comments, and/or additions to this file to: | |
17 | # bug-gdb@gnu.org | |
18 | ||
19 | # This is a regression test for gdb/568 in the sources.redhat.com | |
20 | # GNATS database. As of early June 2002, GDB could get sort of wedged | |
21 | # debugging the program `killed.c': | |
22 | # | |
23 | # $ $D6/gdb/gdb -nw killed | |
24 | # GNU gdb 2002-06-11-cvs | |
25 | # Copyright 2002 Free Software Foundation, Inc. | |
26 | # GDB is free software, covered by the GNU General Public License, and you are | |
27 | # welcome to change it and/or distribute copies of it under certain conditions. | |
28 | # Type "show copying" to see the conditions. | |
29 | # There is absolutely no warranty for GDB. Type "show warranty" for details. | |
30 | # This GDB was configured as "i686-pc-linux-gnu"... | |
31 | # (gdb) run | |
32 | # Starting program: /home/jimb/foo/play/killed | |
33 | # [New Thread 1024 (LWP 6487)] | |
34 | # [New Thread 2049 (LWP 6488)] | |
35 | # [New Thread 1026 (LWP 6489)] | |
36 | # Cannot find user-level thread for LWP 6487: generic error | |
37 | # (gdb) quit | |
38 | # The program is running. Exit anyway? (y or n) y | |
39 | # Cannot find thread 2049: generic error | |
40 | # (gdb) kill | |
41 | # Kill the program being debugged? (y or n) y | |
42 | # Cannot find thread 2049: generic error | |
43 | # (gdb) The program is running. Exit anyway? (y or n) y | |
44 | # Cannot find thread 2049: generic error | |
45 | # (gdb) | |
46 | # [7]+ Stopped $D6/gdb/gdb -nw killed | |
47 | # $ kill %7 | |
48 | # | |
49 | # [7]+ Stopped $D6/gdb/gdb -nw killed | |
50 | # $ kill -9 %7 | |
51 | # | |
52 | # [7]+ Stopped $D6/gdb/gdb -nw killed | |
53 | # $ | |
54 | # [7]+ Killed $D6/gdb/gdb -nw killed | |
55 | # $ | |
56 | ||
38fc42c8 | 57 | |
0efbbabc | 58 | standard_testfile |
38fc42c8 | 59 | |
0efbbabc | 60 | if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } { |
b5ab8ff3 | 61 | return -1 |
38fc42c8 JB |
62 | } |
63 | ||
64 | ||
0efbbabc | 65 | clean_restart ${binfile} |
38fc42c8 | 66 | |
d1d69fdd DJ |
67 | gdb_run_cmd |
68 | gdb_expect { | |
69 | -re "$gdb_prompt $" { | |
70 | pass "run program to completion" | |
71 | } | |
a6cd0eb3 | 72 | timeout { |
d1d69fdd DJ |
73 | fail "run program to completion (timeout)" |
74 | } | |
75 | } | |
38fc42c8 JB |
76 | |
77 | # Try to quit. | |
78 | send_gdb "quit\n" | |
79 | gdb_expect { | |
b8fa0bfa | 80 | -re "Quit anyway\\? \\(y or n\\) $" { |
38fc42c8 JB |
81 | send_gdb "y\n" |
82 | exp_continue | |
83 | } | |
84 | eof { | |
85 | pass "GDB exits after multi-threaded program exits messily" | |
86 | } | |
87 | -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" { | |
8d77e5c3 | 88 | kfail "gdb/568" "GDB exits after multi-threaded program exits messily" |
38fc42c8 JB |
89 | } |
90 | timeout { | |
91 | fail "GDB exits after multi-threaded program exits messily (timeout)" | |
92 | } | |
93 | } |