URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
24 |
jeremybenn |
# Copyright (C) 2008 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 .
|
15 |
|
|
|
16 |
|
|
# Only GNU/Linux is known to support `set follow-fork-mode child'.
|
17 |
|
|
if { ! [istarget "*-*-linux*"] } {
|
18 |
|
|
return 0
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
set testfile fork-child-threads
|
22 |
|
|
set srcfile ${testfile}.c
|
23 |
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
24 |
|
|
|
25 |
|
|
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
26 |
|
|
return -1
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
gdb_exit
|
30 |
|
|
gdb_start
|
31 |
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
32 |
|
|
|
33 |
|
|
gdb_load ${binfile}
|
34 |
|
|
if ![runto_main] then {
|
35 |
|
|
fail "Can't run to main"
|
36 |
|
|
return 0
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
gdb_test "set follow-fork-mode child"
|
40 |
|
|
gdb_breakpoint "start"
|
41 |
|
|
gdb_test "continue" "Breakpoint 2, start.*" "get to the spawned thread"
|
42 |
|
|
|
43 |
|
|
# Wrong:
|
44 |
|
|
# * 2 LWP 4466 start (arg=0x0) at fork-child-threads.c:28
|
45 |
|
|
# Correct:
|
46 |
|
|
# * 3 Thread 0x40a00950 (LWP 5553) start (arg=0x0) at ../.././gdb/testsuite/gdb.threads/fork-child-threads.c:28
|
47 |
|
|
# 2 Thread 0x2aaaaaac3000 (LWP 5552) 0x00000031674076dd in pthread_join (threadid=, thread_return=) at pthread_join.c:89
|
48 |
|
|
|
49 |
|
|
gdb_test "info threads" " Thread .* Thread .*" "two threads found"
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.