Copyright year update in most files of the GDB Project.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-ns-stale-regcache.exp
CommitLineData
0b302171 1# Copyright 2002-2005, 2007-2012 Free Software Foundation, Inc.
e66408ed
PA
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
16# Regression test for PR11557. Make sure we don't end up with a stale
17# register cache just after resuming a thread.
18
d5b4a7be
YQ
19if { ![support_displaced_stepping] } {
20 unsupported "displaced stepping"
21 return -1
22}
23
e66408ed
PA
24load_lib mi-support.exp
25set MIFLAGS "-i=mi"
26
27gdb_exit
28if {[mi_gdb_start]} {
29 continue
30}
31
32proc mi_nonstop_resume { command test } {
33 if { [mi_send_resuming_command $command $test] != 0 } {
34 # If a resume fails, assume non-stop is broken or unsupported
35 # for this target. We have logged a FAIL or UNSUPPORTED; skip
36 # the remaining tests to limit timeouts.
37 return -code continue
38 }
39}
40
41#
42# Start here
43#
44set testfile "ns-stale-regcache"
45set srcfile "$testfile.c"
46set binfile "$objdir/$subdir/mi-$testfile"
47
48set options [list debug incdir=$objdir]
49if {[gdb_compile "$srcdir/$subdir/$srcfile" \
50 $binfile executable $options] != "" } {
51 return -1
52}
53
54mi_gdb_reinitialize_dir $srcdir/$subdir
55mi_gdb_load $binfile
56
e66408ed
PA
57mi_gdb_test "-gdb-set non-stop 1" ".*"
58mi_gdb_test "-gdb-set target-async 1" ".*"
fcdfa280 59mi_detect_async
e66408ed
PA
60
61if { [mi_run_to_main] < 0 } {
e66408ed
PA
62 continue
63}
64
65# Check that register and stack info don't end up stale after resuming
66# a thread.
67mi_nonstop_resume "exec-continue" "resume thread"
68
69mi_gdb_test "-data-evaluate-expression \$pc" \
70 "\\^error,msg=\".*\"" "no stale register cache of resumed thread"
71
72mi_gdb_test "-stack-info-frame" \
73 "\\^error,msg=\".*\"" "no stale frame info of resumed thread"
74
75# Check that the thread is still running. If the above tests passed,
76# we want it to be for the right reasons.
77mi_check_thread_states {"running"} "main thread still running"
78
79mi_gdb_exit
This page took 0.22296 seconds and 4 git commands to generate.