Commit | Line | Data |
---|---|---|
9b254dd1 | 1 | # Copyright 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. |
d1a2f204 KS |
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 |
d1a2f204 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
d1a2f204 KS |
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 | # |
d1a2f204 | 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/>. |
d1a2f204 KS |
15 | |
16 | # Please email any bugs, comments, and/or additions to this file to: | |
17 | # bug-gdb@prep.ai.mit.edu | |
18 | ||
19 | # This file checks for the bug gdb/669, where the console | |
20 | # command "info threads" and the MI command "-thread-list-ids" | |
21 | # return different threads in the system. | |
22 | ||
23 | # This only works with native configurations | |
24 | if {![isnative]} { | |
25 | return | |
26 | } | |
27 | ||
28 | load_lib mi-support.exp | |
29 | set MIFLAGS "-i=mi" | |
30 | ||
31 | gdb_exit | |
32 | if {[mi_gdb_start]} { | |
33 | continue | |
34 | } | |
35 | ||
d1a2f204 KS |
36 | # |
37 | # Start here | |
38 | # | |
39 | set testfile "pthreads" | |
40 | set srcfile "$testfile.c" | |
19ac3974 | 41 | set binfile "$objdir/$subdir/gdb669-$testfile" |
d1a2f204 | 42 | |
dc62bfc2 | 43 | set options [list debug incdir=$objdir] |
2bd4c7b1 MK |
44 | if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { |
45 | return -1 | |
d1a2f204 KS |
46 | } |
47 | ||
d1a2f204 KS |
48 | mi_run_to_main |
49 | check_mi_and_console_threads "at main" | |
50 | ||
51 | for {set i 0} {$i < 4} {incr i} { | |
52 | mi_next "next, try $i" | |
53 | check_mi_and_console_threads "try $i" | |
54 | } | |
55 | ||
56 | mi_gdb_exit | |
57 |