1 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
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.
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.
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/>.
16 # This file was written by Manoj Iyer. (manjo@austin.ibm.com)
17 # Test break points and single step on thread functions.
20 # - Test that breakpoints, continue in a threaded application works.
21 # On powerpc64-unknown-linux-gnu system, running kernel version
22 # 2.6.5-7.71-pseries64 this test is known to fail due to kernel bug
23 # in ptrace system call.
26 # - thread_check.c creates 2 threads
28 # - create 2 breakpoints #1 main() #2 tf() (the thread function)
29 # - run gdb till #1 main() breakpoint is reached
30 # - continue to breakpoint #2 tf()
31 # - delete all breakpoints
37 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
42 clean_restart ${binfile}
44 if ![runto_main] then {
45 fail "Can't run to main"
51 # set breakpoint at thread fucntion tf
54 "Breakpoint.*at.* file .*$srcfile, line.*" \
60 # continue to tf() breakpoint #2
63 ".*Breakpoint 2,.*tf.*at.*$srcfile:.*" \
67 # backtrace from thread function.
69 gdb_test "backtrace" \
70 "#0 .*tf .*at .*$srcfile:.*" \
71 "backtrace from thread function"
75 # delete all breakpoints