aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.xml/tdesc-regs.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.xml/tdesc-regs.exp')
-rw-r--r--gdb/testsuite/gdb.xml/tdesc-regs.exp32
1 files changed, 26 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index fde2111..43d6c99 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -27,10 +27,13 @@ gdb_start
set core-regs ""
switch -glob -- [istarget] {
"*arm-*-*" {
- set core-regs arm-core
+ set core-regs {arm-core.xml}
}
"xscale-*-*" {
- set core-regs arm-core
+ set core-regs {arm-core.xml}
+ }
+ "mips*-*-*" {
+ set core-regs {mips-cpu.xml mips-cp0.xml mips-fpu.xml}
}
}
@@ -56,17 +59,32 @@ gdb_test "set tdesc file $srcdir/$subdir/single-reg.xml" \
# Copy the core registers into the objdir if necessary, so that they
# will be found by <xi:include>.
-file delete "core-regs.xml"
-file copy "$srcdir/../features/${core-regs}.xml" "core-regs.xml"
+foreach src ${core-regs} {
+ file delete "$src"
+ file copy "$srcdir/../features/$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"
- file copy "$srcdir/$subdir/$file" "regs.xml"
+ set ifd [open "$srcdir/$subdir/$file" r]
+ set ofd [open "regs.xml" w]
+ while {[gets $ifd line] >= 0} {
+ if {[regexp {<xi:include href="core-regs.xml"/>} $line]} {
+ foreach src ${core-regs} {
+ puts $ofd " <xi:include href=\"$src\"/>"
+ }
+ } 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"
@@ -91,5 +109,7 @@ load_description "core-only.xml" ""
# The extra register from the previous description should be gone.
gdb_test "ptype \$extrareg" "type = void"
-file delete "core-regs.xml"
+foreach src ${core-regs} {
+ file delete "$src"
+}
file delete "regs.xml"