gdb/testsuite/
* gdb.threads/attachstop-mt.exp: Note a real testcase name this testcase is derived from. Fix racy dependency on an expected PID number. No longer support the testcase on Linux kernel 2.4.x.
This commit is contained in:
parent
6593d811a0
commit
1a6f01b5dc
|
@ -1,3 +1,9 @@
|
||||||
|
2008-09-28 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.threads/attachstop-mt.exp: Note a real testcase name this
|
||||||
|
testcase is derived from. Fix racy dependency on an expected PID
|
||||||
|
number. No longer support the testcase on Linux kernel 2.4.x.
|
||||||
|
|
||||||
2008-09-27 Tom Tromey <tromey@redhat.com>
|
2008-09-27 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* gdb.base/macscp.exp: Add tests for stringification, splicing,
|
* gdb.base/macscp.exp: Add tests for stringification, splicing,
|
||||||
|
|
|
@ -14,9 +14,8 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# This test was created by modifying gdb.threads/attachstop.
|
# This test is based on gdb.base/attach.exp with modifications by Jeff Johnston
|
||||||
# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
# <jjohnstn@redhat.com> and Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||||
# Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584
|
|
||||||
|
|
||||||
# This test only works on Linux
|
# This test only works on Linux
|
||||||
if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
|
if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
|
||||||
|
@ -52,17 +51,25 @@ set testpid [eval exec $binfile &]
|
||||||
# No race
|
# No race
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
# Do not: set testpid2 [expr $testpid + 1]
|
# The testcase has three threads, find some other thread TID for $testpid2.
|
||||||
# as it will not exist on Red Hat 2.6.9-34.0.2.ELsmp
|
set tids [exec sh -c "echo /proc/$testpid/task/*"]
|
||||||
set testpid2 [expr $testpid + 2]
|
regsub -all /proc/$testpid/task/ $tids {} tids
|
||||||
|
if {$tids == "*"} {
|
||||||
set status2 /proc/${testpid}/task/${testpid2}/status
|
unresolved "/proc/PID/task is not supported (kernel-2.4?)"
|
||||||
if {[expr ! [file exists $status2]]} {
|
remote_exec build "kill -9 ${testpid}"
|
||||||
# kernel-2.4
|
return -1
|
||||||
set status2 /proc/${testpid2}/status
|
|
||||||
}
|
}
|
||||||
|
set tids [lsort -integer [split $tids]]
|
||||||
|
if {[llength $tids] != 3 || [lindex $tids 0] != $testpid} {
|
||||||
|
verbose -log "Invalid TIDs <$tids> for PID $testpid"
|
||||||
|
fail "Invalid TIDs found"
|
||||||
|
remote_exec build "kill -9 ${testpid}"
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
set testpid2 [lindex $tids 2]
|
||||||
|
|
||||||
# Initial sanity test it is normally sleeping
|
# Initial sanity test it is normally sleeping
|
||||||
|
set status2 /proc/${testpid}/task/${testpid2}/status
|
||||||
set fileid0 [open $status2 r];
|
set fileid0 [open $status2 r];
|
||||||
gets $fileid0 line1;
|
gets $fileid0 line1;
|
||||||
gets $fileid0 line2;
|
gets $fileid0 line2;
|
||||||
|
|
Loading…
Reference in New Issue