use gnulib's update-copyright script to update copyright years
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-ns-stale-regcache.exp
CommitLineData
7b6bb8da 1# Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
e66408ed
PA
2# Free Software Foundation, Inc.
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17# Regression test for PR11557. Make sure we don't end up with a stale
18# register cache just after resuming a thread.
19
d5b4a7be
YQ
20if { ![support_displaced_stepping] } {
21 unsupported "displaced stepping"
22 return -1
23}
24
e66408ed
PA
25load_lib mi-support.exp
26set MIFLAGS "-i=mi"
27
28gdb_exit
29if {[mi_gdb_start]} {
30 continue
31}
32
33proc mi_nonstop_resume { command test } {
34 if { [mi_send_resuming_command $command $test] != 0 } {
35 # If a resume fails, assume non-stop is broken or unsupported
36 # for this target. We have logged a FAIL or UNSUPPORTED; skip
37 # the remaining tests to limit timeouts.
38 return -code continue
39 }
40}
41
42#
43# Start here
44#
45set testfile "ns-stale-regcache"
46set srcfile "$testfile.c"
47set binfile "$objdir/$subdir/mi-$testfile"
48
49set options [list debug incdir=$objdir]
50if {[gdb_compile "$srcdir/$subdir/$srcfile" \
51 $binfile executable $options] != "" } {
52 return -1
53}
54
55mi_gdb_reinitialize_dir $srcdir/$subdir
56mi_gdb_load $binfile
57
e66408ed
PA
58mi_gdb_test "-gdb-set non-stop 1" ".*"
59mi_gdb_test "-gdb-set target-async 1" ".*"
fcdfa280 60mi_detect_async
e66408ed
PA
61
62if { [mi_run_to_main] < 0 } {
e66408ed
PA
63 continue
64}
65
66# Check that register and stack info don't end up stale after resuming
67# a thread.
68mi_nonstop_resume "exec-continue" "resume thread"
69
70mi_gdb_test "-data-evaluate-expression \$pc" \
71 "\\^error,msg=\".*\"" "no stale register cache of resumed thread"
72
73mi_gdb_test "-stack-info-frame" \
74 "\\^error,msg=\".*\"" "no stale frame info of resumed thread"
75
76# Check that the thread is still running. If the above tests passed,
77# we want it to be for the right reasons.
78mi_check_thread_states {"running"} "main thread still running"
79
80mi_gdb_exit
This page took 0.208673 seconds and 4 git commands to generate.