test: cover subranges with present DW_AT_count attribute
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / info-threads-cur-sal.exp
CommitLineData
ecd75fc8 1# Copyright (C) 2013-2014 Free Software Foundation, Inc.
08d72866
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
16standard_testfile info-threads-cur-sal.c info-threads-cur-sal-2.c
17
18set executable ${testfile}
19
20if {[gdb_compile_pthreads \
21 "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" \
22 "${binfile}" executable {debug}] != "" } {
23 return -1
24}
25
26clean_restart ${executable}
27
28if ![runto_main] {
29 return -1
30}
31
32gdb_breakpoint "start"
33gdb_continue_to_breakpoint "start"
34
35set line [gdb_get_line_number "should show this line" "${srcfile2}"]
36
37gdb_test "list $line" \
38 "\"list\" should show this line.*" \
39 "list before info threads"
40
41# There used to be a bug where "info threads" would set the current
42# SAL to the location of the last thread displayed.
43gdb_test "info threads" \
44 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*\r\n 1 *Thread \[^\r\n\]* .* \[^\r\n\]*" \
45 "info threads before break"
46
47# Check that "break" is still operating on the same file by default.
48gdb_test "break $line" ".*${srcfile2}.*" "break on line"
49
50gdb_test "info threads" \
51 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*\r\n 1 *Thread \[^\r\n\]* .* \[^\r\n\]*" \
52 "info threads before list"
53
54# And that so is "list".
55gdb_test "list $line" \
56 "\"list\" should show this line.*" \
57 "list after info threads"
This page took 0.095143 seconds and 4 git commands to generate.