URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gdb/gdb-6.8/gdb-6.8.openrisc-2.1/gdb/testsuite/gdb.xml
- from Rev 24 to Rev 33
- ↔ Reverse comparison
Rev 24 → Rev 33
/extra-regs.xml
0,0 → 1,16
<target> |
<xi:include href="core-regs.xml"/> |
<feature name="extra"> |
<vector id="v4int8" type="int8" count="4"/> |
<vector id="v2int16" type="int16" count="2"/> |
<union id="vecint"> |
<field name="v4" type="v4int8"/> |
<field name="v2" type="v2int16"/> |
</union> |
|
<reg name="extrareg" bitsize="32"/> |
<reg name="uintreg" bitsize="32" type="uint32"/> |
<reg name="vecreg" bitsize="32" type="v4int8"/> |
<reg name="unionreg" bitsize="32" type="vecint"/> |
</feature> |
</target> |
extra-regs.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inc-body.xml
===================================================================
--- inc-body.xml (nonexistent)
+++ inc-body.xml (revision 33)
@@ -0,0 +1 @@
+invalid-body
inc-body.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: includes.xml
===================================================================
--- includes.xml (nonexistent)
+++ includes.xml (revision 33)
@@ -0,0 +1,3 @@
+
+
+
includes.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: bad-include.xml
===================================================================
--- bad-include.xml (nonexistent)
+++ bad-include.xml (revision 33)
@@ -0,0 +1 @@
+
bad-include.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: core-only.xml
===================================================================
--- core-only.xml (nonexistent)
+++ core-only.xml (revision 33)
@@ -0,0 +1,3 @@
+
+
+
core-only.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tdesc-xinclude.exp
===================================================================
--- tdesc-xinclude.exp (nonexistent)
+++ tdesc-xinclude.exp (revision 33)
@@ -0,0 +1,53 @@
+# Copyright 2007, 2008 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 3 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, see .
+
+if {[gdb_skip_xml_test]} {
+ unsupported "tdesc-errors.exp"
+ return -1
+}
+
+gdb_start
+
+proc set_arch { srcfile errmsg } {
+ global gdb_prompt
+ global srcdir
+ global subdir
+
+ # Anchor the test output, so that error messages are detected.
+ set cmd "set tdesc filename $srcdir/$subdir/$srcfile"
+ set msg "set tdesc filename $subdir/$srcfile"
+ set cmd_regex [string_to_regexp $cmd]
+ gdb_test_multiple $cmd $msg {
+ -re "^$cmd_regex\r\n$errmsg$gdb_prompt $" {
+ pass $msg
+ }
+ }
+}
+
+set common_warn "\r\nwarning: Could not load XML target description; ignoring\r\n"
+
+# This file is valid, but specifies an unknown architecture.
+# We should get a warning, if we process the includes correctly.
+set_arch "includes.xml" \
+ "warning:.*specified unknown architecture.* \"invalid-body\"$common_warn"
+
+# This file contains a missing include. We should warn the user about
+# it.
+set_arch "bad-include.xml" \
+ "warning:.*Could not load XML document \"nonexistant.xml\"$common_warn"
+
+# Make sure we detect infinite loops, eventually.
+set_arch "loop.xml" \
+ "warning:.*Maximum XInclude depth.*$common_warn"
Index: inc-2.xml
===================================================================
--- inc-2.xml (nonexistent)
+++ inc-2.xml (revision 33)
@@ -0,0 +1 @@
+
inc-2.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tdesc-errors.exp
===================================================================
--- tdesc-errors.exp (nonexistent)
+++ tdesc-errors.exp (revision 33)
@@ -0,0 +1,48 @@
+# Copyright 2007, 2008 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 3 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, see .
+
+if {[gdb_skip_xml_test]} {
+ unsupported "tdesc-errors.exp"
+ return -1
+}
+
+gdb_start
+
+proc set_bad_arch { srcfile errmsg } {
+ global gdb_prompt
+ global srcdir
+ global subdir
+
+ # Anchor the test output, so that error messages are detected.
+ set cmd "set tdesc filename $srcdir/$subdir/$srcfile"
+ set msg "set tdesc filename $subdir/$srcfile"
+ set cmd_regex [string_to_regexp $cmd]
+ gdb_test_multiple $cmd $msg {
+ -re "^$cmd_regex\r\n$errmsg$gdb_prompt $" {
+ pass $msg
+ }
+ }
+}
+
+set common_warn "\r\nwarning: Could not load XML target description; ignoring\r\n"
+
+# This file contains a syntax error. We should warn the user about
+# it.
+set_bad_arch "tdesc-bogus.xml" \
+ "warning: while parsing .*: no element found$common_warn"
+
+# This file contains a bunch of unrecognized elements. They should be
+# silently ignored.
+set_bad_arch "tdesc-unknown.xml" ""
Index: loop.xml
===================================================================
--- loop.xml (nonexistent)
+++ loop.xml (revision 33)
@@ -0,0 +1 @@
+
loop.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tdesc-arch.exp
===================================================================
--- tdesc-arch.exp (nonexistent)
+++ tdesc-arch.exp (revision 33)
@@ -0,0 +1,111 @@
+# Copyright 2007, 2008 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 3 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, see .
+
+if {[gdb_skip_xml_test]} {
+ unsupported "tdesc-arch.exp"
+ return -1
+}
+
+gdb_start
+
+# Find some valid architectures - we just need legitimate values
+# to put in our elements.
+set arch1 ""
+set arch2 ""
+set msg "read valid architectures"
+gdb_test_multiple "set architecture" $msg {
+ -re "Requires an argument. Valid arguments are (\[^ \]*), (\[^ \]*), .*auto\\.\r\n$gdb_prompt $" {
+ set arch1 $expect_out(1,string)
+ set arch2 $expect_out(2,string)
+ pass $msg
+ }
+ -re "Requires an argument. Valid arguments are (\[^ \]*), auto\\.\r\n$gdb_prompt $" {
+ # If there is just one supported architecture, we can't do this test.
+ unsupported "tdesc-arch.exp"
+ return -1
+ }
+}
+
+set default_arch ""
+set msg "read default architecture"
+gdb_test_multiple "show architecture" $msg {
+ -re "The target architecture is set automatically \\(currently (\[^ \]*)\\)\r\n$gdb_prompt $" {
+ set default_arch $expect_out(1,string)
+ pass $msg
+ }
+}
+
+# If that did not work, no point running further tests.
+if { "$arch1" == "" || "$arch2" == "" || "$default_arch" == "" } {
+ unresolved "architecture XML tests"
+ return -1
+}
+
+# Run these tests twice, once for $arch1 and once for $arch2, to
+# make sure that the tdesc file overrides the global default.
+
+proc set_arch { arch which } {
+ global gdb_prompt
+
+ set fd [open "tdesc-arch.xml" w]
+ puts $fd \
+ "
+ $arch
+ "
+ close $fd
+
+ # Anchor the test output, so that error messages are detected.
+ set cmd "set tdesc filename tdesc-arch.xml"
+ set msg "$cmd ($which architecture)"
+ set cmd_regex [string_to_regexp $cmd]
+ gdb_test_multiple $cmd $msg {
+ -re "^$cmd_regex\r\n$gdb_prompt $" {
+ pass $msg
+ }
+ -re "^$cmd_regex\r\nwarning: A handler for the OS ABI.*\r\n$gdb_prompt $" {
+ kfail gdb/2225 $msg
+ }
+ }
+
+ set cmd "show architecture"
+ gdb_test $cmd \
+ "The target architecture is set automatically \\(currently $arch\\)" \
+ "$cmd ($which architecture)"
+
+ file delete "tdesc-arch.xml"
+}
+
+set_arch $arch1 first
+set_arch $arch2 second
+
+# Check an invalid architecture setting.
+set fd [open "tdesc-arch.xml" w]
+puts $fd \
+ "
+ invalid
+ "
+close $fd
+
+set cmd "set tdesc filename tdesc-arch.xml"
+gdb_test $cmd \
+ "warning:.*Target description specified unknown architecture.*" \
+ "$cmd (invalid architecture)"
+
+set cmd "show architecture"
+gdb_test $cmd \
+ "The target architecture is set automatically \\(currently $default_arch\\)" \
+ "$cmd (invalid architecture)"
+
+file delete "tdesc-arch.xml"
Index: trivial.xml
===================================================================
--- trivial.xml (nonexistent)
+++ trivial.xml (revision 33)
@@ -0,0 +1 @@
+
trivial.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: single-reg.xml
===================================================================
--- single-reg.xml (nonexistent)
+++ single-reg.xml (revision 33)
@@ -0,0 +1,5 @@
+
+
+
+
+
single-reg.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tdesc-regs.exp
===================================================================
--- tdesc-regs.exp (nonexistent)
+++ tdesc-regs.exp (revision 33)
@@ -0,0 +1,119 @@
+# Copyright 2007, 2008 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 3 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, see .
+
+if {[gdb_skip_xml_test]} {
+ unsupported "tdesc-regs.exp"
+ return -1
+}
+
+gdb_start
+
+# To test adding registers, we need a core set of registers for this
+# architecture, or the description will be rejected.
+
+set core-regs ""
+set regdir ""
+switch -glob -- [istarget] {
+ "*arm-*-*" {
+ set core-regs {arm-core.xml}
+ }
+ "xscale-*-*" {
+ set core-regs {arm-core.xml}
+ }
+ "mips*-*-*" {
+ set core-regs {mips-cpu.xml mips-cp0.xml mips-fpu.xml}
+ }
+ "powerpc*-*-*" {
+ set regdir "rs6000/"
+ set core-regs {power-core.xml}
+ }
+}
+
+# If no core registers were specified, assume this target does not
+# support target-defined registers. Verify that we get a warning if
+# we try to use them. This not only tests the warning, but also
+# reminds maintainers to add test support when they add the feature.
+if {[string equal ${core-regs} ""]} {
+ gdb_test "set tdesc file $srcdir/$subdir/single-reg.xml" \
+ "warning: Target-supplied registers are not supported.*" \
+ "set tdesc file single-reg.xml"
+ unsupported "register tests"
+ return 0
+}
+
+# Otherwise, we support both XML and target defined registers.
+
+# Make sure we reject a description missing standard registers,
+# like the PC.
+gdb_test "set tdesc file $srcdir/$subdir/single-reg.xml" \
+ "warning: Architecture rejected target-supplied description" \
+ "set tdesc file single-reg.xml"
+
+# Copy the core registers into the objdir if necessary, so that they
+# will be found by .
+foreach src ${core-regs} {
+ file delete "$src"
+ file copy "$srcdir/../features/$regdir$src" "$src"
+}
+
+# Similarly, we need to copy files under test into the objdir.
+proc load_description { file errmsg } {
+ global srcdir
+ global subdir
+ global gdb_prompt
+ global core-regs
+
+ file delete "regs.xml"
+ set ifd [open "$srcdir/$subdir/$file" r]
+ set ofd [open "regs.xml" w]
+ while {[gets $ifd line] >= 0} {
+ if {[regexp { } $line]} {
+ foreach src ${core-regs} {
+ puts $ofd " "
+ }
+ } else {
+ puts $ofd $line
+ }
+ }
+ close $ifd
+ close $ofd
+
+ # Anchor the test output, so that error messages are detected.
+ set cmd "set tdesc filename regs.xml"
+ set msg "set tdesc filename $file"
+ set cmd_regex [string_to_regexp $cmd]
+ gdb_test_multiple $cmd $msg {
+ -re "^$cmd_regex\r\n$errmsg$gdb_prompt $" {
+ pass $msg
+ }
+ }
+}
+
+load_description "extra-regs.xml" ""
+gdb_test "ptype \$extrareg" "type = (int|long|long long)"
+gdb_test "ptype \$uintreg" "type = uint32_t"
+gdb_test "ptype \$vecreg" "type = int8_t \\\[4\\\]"
+gdb_test "ptype \$unionreg" \
+ "type = union {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
+gdb_test "ptype \$unionreg.v4" "type = int8_t \\\[4\\\]"
+
+load_description "core-only.xml" ""
+# The extra register from the previous description should be gone.
+gdb_test "ptype \$extrareg" "type = void"
+
+foreach src ${core-regs} {
+ file delete "$src"
+}
+file delete "regs.xml"
Index: tdesc-bogus.xml
===================================================================
--- tdesc-bogus.xml (nonexistent)
+++ tdesc-bogus.xml (revision 33)
@@ -0,0 +1,3 @@
+
+
tdesc-bogus.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tdesc-unknown.xml
===================================================================
--- tdesc-unknown.xml (nonexistent)
+++ tdesc-unknown.xml (revision 33)
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
tdesc-unknown.xml
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property