Commit | Line | Data |
---|---|---|
c906108c | 1 | # Tests of register displays for GDB. |
0fb0cc75 | 2 | # Copyright 1994, 1995, 2007, 2008, 2009 Free Software Foundation, Inc. |
c906108c SS |
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 | |
e22f8b7c | 6 | # the Free Software Foundation; either version 3 of the License, or |
c906108c | 7 | # (at your option) any later version. |
e22f8b7c | 8 | # |
c906108c SS |
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. | |
e22f8b7c | 13 | # |
c906108c | 14 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
c906108c | 16 | |
c906108c SS |
17 | # This file was written by Stan Shebs. (shebs@cygnus.com) |
18 | ||
19 | # This does not (yet) have an associated executable, since the IDT board | |
20 | # will display registers even without a program being loaded. | |
21 | # A more comprehensive register test would actually test reading | |
22 | # and writing of registers in a real program, although some care | |
23 | # would be required in the writing of the tests. | |
24 | ||
25 | if $tracelevel then { | |
26 | strace $tracelevel | |
27 | } | |
28 | ||
29 | # These tests exercise IDT-specific MIPS registers for several | |
30 | # different processor models. | |
31 | ||
32 | # This should detect the actual processor in use and change | |
33 | # the expected results appropriately. FIXME | |
34 | ||
35 | proc idt_register_tests { } { | |
36 | # Test the generic IDT chip. | |
37 | gdb_test "info registers" ".*" | |
38 | gdb_test "info register zero" "zero(r0): 0x0;" | |
39 | # FIXME access each generic register individually | |
40 | # Test the 3041. | |
41 | gdb_test "set processor r3041" ".*" | |
42 | gdb_test "info registers" ".*" | |
43 | gdb_test "info register bus" "bus.*0x.*" | |
44 | gdb_test "info register ccfg" "ccfg.*0x.*" | |
45 | gdb_test "info register port" "port.*0x.*" | |
46 | gdb_test "info register cmp" "cmp.*0x.*" | |
47 | gdb_test "info register elo" "elo: invalid register" | |
48 | gdb_test "info register ehi" "ehi: invalid register" | |
49 | gdb_test "info register cfg" "cfg: invalid register" | |
50 | gdb_test "info register ctxt" "ctxt: invalid register" | |
51 | # Test the 3051. | |
52 | gdb_test "set processor r3051" ".*" | |
53 | gdb_test "info registers" ".*" | |
54 | gdb_test "info register bus" "bus: invalid register" | |
55 | gdb_test "info register ccfg" "ccfg: invalid register" | |
56 | gdb_test "info register port" "port: invalid register" | |
57 | gdb_test "info register cmp" "cmp: invalid register" | |
58 | gdb_test "info register elo" "elo.*0x.*" | |
59 | gdb_test "info register ehi" "ehi.*0x.*" | |
60 | gdb_test "info register cfg" "cfg: invalid register" | |
61 | gdb_test "info register ctxt" "ctxt: invalid register" | |
62 | # Test the 3071. | |
63 | gdb_test "set processor r3071" ".*" | |
64 | gdb_test "info registers" ".*" | |
65 | gdb_test "info register bus" "bus: invalid register" | |
66 | gdb_test "info register ccfg" "ccfg: invalid register" | |
67 | gdb_test "info register port" "port: invalid register" | |
68 | gdb_test "info register cmp" "cmp: invalid register" | |
69 | gdb_test "info register elo" "elo.*0x.*" | |
70 | gdb_test "info register ehi" "ehi.*0x.*" | |
71 | gdb_test "info register cfg" "cfg.*0x.*" | |
72 | gdb_test "info register ctxt" "ctxt.*0x.*" | |
73 | } | |
74 | ||
75 | if [istarget "mips*-idt-*"] then { | |
76 | gdb_exit | |
77 | gdb_start | |
78 | gdb_reinitialize_dir $srcdir/$subdir | |
79 | idt_register_tests | |
80 | } else { | |
81 | verbose "regs.exp tests ignored for this target" | |
82 | } |