]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.threads/current-lwp-dead.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / current-lwp-dead.exp
1 # This testcase is part of GDB, the GNU debugger.
2
3 # Copyright 2009-2024 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 # Regression test for issue originally described here:
19 #
20 # https://sourceware.org/legacy-ml/gdb-patches/2009-06/msg00802.html
21 #
22 # The relevant code has since been removed from GDB, but it doesn't
23 # hurt to keep the testcase.
24
25 standard_testfile
26
27 # This only works with on Linux targets.
28 if {![istarget *-*-linux*]} {
29 return
30 }
31
32 if { [prepare_for_testing "failed to prepare" current-lwp-dead] } {
33 return -1
34 }
35
36 if {[runto_main] <= 0} {
37 return -1
38 }
39
40 # Run to "fn" so that thread 2 is made current.
41 gdb_breakpoint "fn"
42 gdb_continue_to_breakpoint "fn" ".*do_clone.*"
43
44 # Run to thread 3, at a point where thread 2 is gone.
45 set line [gdb_get_line_number "at-fn_return"]
46 gdb_breakpoint $line
47 gdb_continue_to_breakpoint "fn_return" ".*at-fn_return.*"
48
49 # Confirm thread 2 is really gone.
50 gdb_test "info threads 2" "No threads match '2'\\."
51
52 gdb_continue_to_end "" continue 1