* [PATCH] Copy xml files to host if it is remote
@ 2013-09-26 1:14 Yao Qi
2013-10-02 14:27 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Yao Qi @ 2013-09-26 1:14 UTC (permalink / raw)
To: gdb-patches
Hi,
When I run testsuite in a remote host way, I find there are some fails
in gdb.xml are caused by using directory on build, like
(gdb) set tdesc filename
../../../../git/gdb/testsuite/gdb.xml/maint_print_struct.xml^M
warning: Could not open
"../../../../git/gdb/testsuite/gdb.xml/maint_print_struct.xml"^M
(gdb) PASS: gdb.xml/maint_print_struct.exp: setting a new tdesc having
only a structure
maint print c-tdesc^M
There is no target description to print.^M
(gdb) FAIL: gdb.xml/maint_print_struct.exp: printing tdesc with a
structure and a bitfield
(gdb) set tdesc file
../../../../git/gdb/testsuite/gdb.xml/single-reg.xml^M
warning: Could not open
"../../../../git/gdb/testsuite/gdb.xml/single-reg.xml"^M
(gdb) FAIL: gdb.xml/tdesc-regs.exp: set tdesc file single-reg.xml
(gdb) set tdesc filename
../../../../git/gdb/testsuite/gdb.xml/trivial.xml^M
warning: Could not open
"../../../../git/gdb/testsuite/gdb.xml/trivial.xml"^M
This patch is to copy needed xml files from build to host, and update
the file directory in the tests.
gdb/testsuite:
2013-09-26 Yao Qi <yao@codesourcery.com>
* gdb.xml/maint_print_struct.exp: Copy maint_print_struct.xml
to host if it is remote.
* gdb.xml/tdesc-errors.exp (set_bad_arch): Copy $srcfile to
host if it is remote. Update $cmd and $msg.
* gdb.xml/tdesc-regs.exp: Copy single-reg.xml to host if it is
remote.
* gdb.xml/tdesc-xinclude.exp (set_arch): Copy $srcfile to host
if it is remote. Update $cmd and $msg.
Copy inc-2.xml and inc-body.xml to host if it is remote.
* lib/gdb.exp (gdb_skip_xml_test): Copy trivial.xml to host
if it is remote.
---
gdb/testsuite/gdb.xml/maint_print_struct.exp | 10 +++++++++-
gdb/testsuite/gdb.xml/tdesc-errors.exp | 10 ++++++++--
gdb/testsuite/gdb.xml/tdesc-regs.exp | 11 +++++++++--
gdb/testsuite/gdb.xml/tdesc-xinclude.exp | 15 +++++++++++++--
gdb/testsuite/lib/gdb.exp | 8 +++++++-
5 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.exp b/gdb/testsuite/gdb.xml/maint_print_struct.exp
index 568d174..1b483cc 100644
--- a/gdb/testsuite/gdb.xml/maint_print_struct.exp
+++ b/gdb/testsuite/gdb.xml/maint_print_struct.exp
@@ -24,9 +24,17 @@ if {[gdb_skip_xml_test]} {
gdb_start
+set maint_print_struct_xml "$srcdir/$subdir/maint_print_struct.xml"
+
+if { [is_remote host] } {
+ set maint_print_struct_xml "maint_print_struct.xml"
+ remote_download host "$srcdir/$subdir/maint_print_struct.xml" \
+ $maint_print_struct_xml
+}
+
# Required registers are not present so it is expected a warning.
#
-gdb_test "set tdesc filename $srcdir/$subdir/maint_print_struct.xml" "
+gdb_test "set tdesc filename $maint_print_struct_xml" "
warning:.*" "setting a new tdesc having only a structure"
gdb_test "maint print c-tdesc" "
diff --git a/gdb/testsuite/gdb.xml/tdesc-errors.exp b/gdb/testsuite/gdb.xml/tdesc-errors.exp
index 19f42a1..c639b91 100644
--- a/gdb/testsuite/gdb.xml/tdesc-errors.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-errors.exp
@@ -26,8 +26,14 @@ proc set_bad_arch { srcfile errmsg } {
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"
+ if { [is_remote host] } {
+ remote_download host "$srcdir/$subdir/$srcfile" $srcfile
+ set cmd "set tdesc filename $srcfile"
+ set msg "set tdesc filename $srcfile"
+ } else {
+ 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 $" {
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index 533812f..9999845 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -71,12 +71,19 @@ switch -glob -- [istarget] {
}
}
+set single_reg_xml "$srcdir/$subdir/single-reg.xml"
+
+if { [is_remote host] } {
+ set single_reg_xml "single-reg.xml"
+ remote_download host "$srcdir/$subdir/single-reg.xml" $single_reg_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" \
+ gdb_test "set tdesc file $single_reg_xml" \
"warning: Target-supplied registers are not supported.*" \
"set tdesc file single-reg.xml"
unsupported "register tests"
@@ -87,7 +94,7 @@ if {[string equal ${core-regs} ""]} {
# Make sure we reject a description missing standard registers,
# like the PC.
-gdb_test "set tdesc file $srcdir/$subdir/single-reg.xml" \
+gdb_test "set tdesc file $single_reg_xml" \
"warning: Architecture rejected target-supplied description" \
"set tdesc file single-reg.xml"
diff --git a/gdb/testsuite/gdb.xml/tdesc-xinclude.exp b/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
index d138a24..92e8825 100644
--- a/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
@@ -26,8 +26,14 @@ proc set_arch { srcfile errmsg } {
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"
+ if { [is_remote host] } {
+ remote_download host "$srcdir/$subdir/$srcfile" $srcfile
+ set cmd "set tdesc filename $srcfile"
+ set msg "set tdesc filename $srcfile"
+ } else {
+ 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 $" {
@@ -36,6 +42,11 @@ proc set_arch { srcfile errmsg } {
}
}
+if { [is_remote host] } {
+ remote_download host "$srcdir/$subdir/inc-2.xml" "inc-2.xml"
+ remote_download host "$srcdir/$subdir/inc-body.xml" "inc-body.xml"
+}
+
set common_warn "\r\nwarning: Could not load XML target description; ignoring\r\n"
# This file is valid, but specifies an unknown architecture.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5e3331a..5b02170 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3911,9 +3911,15 @@ gdb_caching_proc gdb_skip_xml_test {
global gdb_prompt
global srcdir
+ set trivial_xml "${srcdir}/gdb.xml/trivial.xml"
+ if { [is_remote host] } {
+ set trivial_xml "trivial.xml"
+ remote_download host "${srcdir}/gdb.xml/trivial.xml" $trivial_xml
+ }
+
gdb_start
set xml_missing 0
- gdb_test_multiple "set tdesc filename ${srcdir}/gdb.xml/trivial.xml" "" {
+ gdb_test_multiple "set tdesc filename $trivial_xml" "" {
-re ".*XML support was disabled at compile time.*$gdb_prompt $" {
set xml_missing 1
}
--
1.7.7.6
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Copy xml files to host if it is remote
2013-09-26 1:14 [PATCH] Copy xml files to host if it is remote Yao Qi
@ 2013-10-02 14:27 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2013-10-02 14:27 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
Hi,
> gdb_test "maint print c-tdesc" "
> diff --git a/gdb/testsuite/gdb.xml/tdesc-errors.exp b/gdb/testsuite/gdb.xml/tdesc-errors.exp
> index 19f42a1..c639b91 100644
> --- a/gdb/testsuite/gdb.xml/tdesc-errors.exp
> +++ b/gdb/testsuite/gdb.xml/tdesc-errors.exp
> @@ -26,8 +26,14 @@ proc set_bad_arch { srcfile errmsg } {
> 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"
> + if { [is_remote host] } {
> + remote_download host "$srcdir/$subdir/$srcfile" $srcfile
> + set cmd "set tdesc filename $srcfile"
> + set msg "set tdesc filename $srcfile"
> + } else {
> + set cmd "set tdesc filename $srcdir/$subdir/$srcfile"
> + set msg "set tdesc filename $subdir/$srcfile"
> + }
It'd be better for test comparison if $msg did not depend on
how the test was ran, e.g., by doing:
set msg "set tdesc filename $srcfile"
unconditionally.
This is OK with that change, here, and whereever else
necessary. I noticed at least one other spot.
Thanks,
--
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-02 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-26 1:14 [PATCH] Copy xml files to host if it is remote Yao Qi
2013-10-02 14:27 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).