1# Copyright (C) 2013-2019 Free Software Foundation, Inc. 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 [multi_line \ 45 "\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*" \ 46 " 1 *Thread \[^\r\n\]* .* \[^\r\n\]*" \ 47 "\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*"] \ 48 "info threads before break" 49 50# Check that "break" is still operating on the same file by default. 51gdb_test "break $line" ".*${srcfile2}.*" "break on line" 52 53gdb_test "info threads" \ 54 [multi_line \ 55 "\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*" \ 56 " 1 *Thread \[^\r\n\]* .* \[^\r\n\]*" \ 57 "\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*"] \ 58 "info threads before list" 59 60# And that so is "list". 61gdb_test "list $line" \ 62 "\"list\" should show this line.*" \ 63 "list after info threads" 64