OLD | NEW |
1 # Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # Please email any bugs, comments, and/or additions to this file to: | 16 # Please email any bugs, comments, and/or additions to this file to: |
17 # bug-gdb@gnu.org | 17 # bug-gdb@gnu.org |
18 | 18 |
19 # This file verifies that GDB is able to compute a backtrace for a thread | 19 # This file verifies that GDB is able to compute a backtrace for a thread |
20 # being blocked on a call to pthread_cond_wait(). | 20 # being blocked on a call to pthread_cond_wait(). |
21 | 21 |
22 if $tracelevel then { | 22 standard_testfile |
23 » strace $tracelevel | |
24 } | |
25 | 23 |
26 set testfile "pthread_cond_wait" | 24 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le debug] != "" } { |
27 set srcfile ${testfile}.c | |
28 set binfile ${objdir}/${subdir}/${testfile} | |
29 | |
30 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le [list debug "incdir=${objdir}"]] != "" } { | |
31 return -1 | 25 return -1 |
32 } | 26 } |
33 | 27 |
34 gdb_exit | 28 clean_restart ${binfile} |
35 gdb_start | |
36 gdb_reinitialize_dir $srcdir/$subdir | |
37 gdb_load ${binfile} | |
38 runto_main | 29 runto_main |
39 | 30 |
40 gdb_test "break break_me" \ | 31 gdb_test "break break_me" \ |
41 "Breakpoint 2 at .*: file .*${srcfile}, line .*" \ | 32 "Breakpoint 2 at .*: file .*${srcfile}, line .*" \ |
42 "breakpoint on break_me" | 33 "breakpoint on break_me" |
43 | 34 |
44 gdb_test "continue" \ | 35 gdb_test "continue" \ |
45 ".*Breakpoint 2, break_me ().*" \ | 36 ".*Breakpoint 2, break_me ().*" \ |
46 "run to break_me" | 37 "run to break_me" |
47 | 38 |
(...skipping 16 matching lines...) Expand all Loading... |
64 | 55 |
65 # One of the threads is blocked on a call to pthread_cond_wait, and | 56 # One of the threads is blocked on a call to pthread_cond_wait, and |
66 # we want to verify that we are able to get a sensible backtrace for | 57 # we want to verify that we are able to get a sensible backtrace for |
67 # that thread. Because we don't know its thread ID, we can't switch | 58 # that thread. Because we don't know its thread ID, we can't switch |
68 # to it before doing the backtrace. So we get a backtrace for all | 59 # to it before doing the backtrace. So we get a backtrace for all |
69 # threads, and verify that one them returns the expected backtrace. | 60 # threads, and verify that one them returns the expected backtrace. |
70 gdb_test "thread apply all backtrace" \ | 61 gdb_test "thread apply all backtrace" \ |
71 "pthread_cond_wait${btb}cond_wait${btb}noreturn${btb}forever_pthread.*" \ | 62 "pthread_cond_wait${btb}cond_wait${btb}noreturn${btb}forever_pthread.*" \ |
72 "backtrace in blocked thread" | 63 "backtrace in blocked thread" |
73 | 64 |
OLD | NEW |