summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/regs.exp
blob: 93ee35a989e61f52f2156bd43b2ecfd883a952d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Tests of register displays for GDB.
#   Copyright 1994, 1995 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  

# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu

# This file was written by Stan Shebs. (shebs@cygnus.com)

# This does not (yet) have an associated executable, since the IDT board
# will display registers even without a program being loaded.
# A more comprehensive register test would actually test reading
# and writing of registers in a real program, although some care
# would be required in the writing of the tests.

if $tracelevel then {
	strace $tracelevel
	}

# These tests exercise IDT-specific MIPS registers for several
# different processor models.

# This should detect the actual processor in use and change
# the expected results appropriately.  FIXME

proc idt_register_tests { } {
	# Test the generic IDT chip.
	gdb_test "info registers" ".*"
	gdb_test "info register zero" "zero(r0): 0x0;"
	# FIXME access each generic register individually
	# Test the 3041.
	gdb_test "set processor r3041" ".*"
	gdb_test "info registers" ".*"
	gdb_test "info register bus"  "bus.*0x.*"
	gdb_test "info register ccfg" "ccfg.*0x.*"
	gdb_test "info register port" "port.*0x.*"
	gdb_test "info register cmp"  "cmp.*0x.*"
	gdb_test "info register elo"  "elo: invalid register"
	gdb_test "info register ehi"  "ehi: invalid register"
	gdb_test "info register cfg"  "cfg: invalid register"
	gdb_test "info register ctxt" "ctxt: invalid register"
	# Test the 3051.
	gdb_test "set processor r3051" ".*"
	gdb_test "info registers" ".*"
	gdb_test "info register bus"  "bus: invalid register"
	gdb_test "info register ccfg" "ccfg: invalid register"
	gdb_test "info register port" "port: invalid register"
	gdb_test "info register cmp"  "cmp: invalid register"
	gdb_test "info register elo"  "elo.*0x.*"
	gdb_test "info register ehi"  "ehi.*0x.*"
	gdb_test "info register cfg"  "cfg: invalid register"
	gdb_test "info register ctxt" "ctxt: invalid register"
	# Test the 3071.
	gdb_test "set processor r3071" ".*"
	gdb_test "info registers" ".*"
	gdb_test "info register bus"  "bus: invalid register"
	gdb_test "info register ccfg" "ccfg: invalid register"
	gdb_test "info register port" "port: invalid register"
	gdb_test "info register cmp"  "cmp: invalid register"
	gdb_test "info register elo"  "elo.*0x.*"
	gdb_test "info register ehi"  "ehi.*0x.*"
	gdb_test "info register cfg"  "cfg.*0x.*"
	gdb_test "info register ctxt" "ctxt.*0x.*"
}

if [istarget "mips*-idt-*"] then {
    gdb_exit
    gdb_start
    gdb_reinitialize_dir $srcdir/$subdir
    idt_register_tests
} else {
    verbose "regs.exp tests ignored for this target"
}