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