Commit | Line | Data |
---|---|---|
ecd75fc8 | 1 | # Copyright (C) 2009-2014 Free Software Foundation, Inc. |
b3444185 PA |
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 | ||
16 | # Test that GDB doesn't get stuck when thread hoping over a thread | |
17 | # specific breakpoint when the selected thread has gone away. | |
18 | ||
0efbbabc | 19 | standard_testfile |
b3444185 PA |
20 | |
21 | if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ | |
0efbbabc | 22 | executable debug] != "" } { |
b3444185 PA |
23 | return -1 |
24 | } | |
25 | ||
0efbbabc | 26 | clean_restart ${binfile} |
b3444185 PA |
27 | |
28 | runto_main | |
29 | ||
30 | # Get ourselves to the thread that exits | |
31 | gdb_breakpoint "thread_function" | |
32 | gdb_test "continue" ".*thread_function.*" "continue to thread start" | |
33 | ||
34 | # Set a thread specific breakpoint somewhere the main thread will pass | |
35 | # by, but make it specific to the thread that is going to exit. Step | |
36 | # over the pthread_exit call. GDB should still be able to step over | |
37 | # the thread specific breakpoint, and reach the other breakpoint, | |
38 | # which is not thread specific. | |
39 | set bpthrline [gdb_get_line_number "set thread specific breakpoint here"] | |
40 | gdb_test "break $bpthrline thread 2" \ | |
41 | "Breakpoint .*$srcfile.*$bpthrline.*" \ | |
42 | "set thread specific breakpoint" | |
43 | ||
44 | set bpexitline [gdb_get_line_number "set exit breakpoint here"] | |
45 | gdb_breakpoint "$bpexitline" | |
46 | ||
27d3a3fc | 47 | gdb_test "continue" \ |
b3444185 PA |
48 | ".*set exit breakpoint here.*" \ |
49 | "get past the thread specific breakpoint" | |
50 | ||
51 | return 0 |