From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 1/2] [gdb/testsuite] Fix gdb.xml/tdesc-reload.exp for remote host
Date: Tue, 21 Mar 2023 11:25:52 +0100 [thread overview]
Message-ID: <20230321102553.14895-2-tdevries@suse.de> (raw)
In-Reply-To: <20230321102553.14895-1-tdevries@suse.de>
Fix test-case gdb.xml/tdesc-reload.exp for remote host by using appropriate
filenames.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.xml/tdesc-reload.exp | 6 +++---
gdb/testsuite/lib/gdb.exp | 10 ++++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.xml/tdesc-reload.exp b/gdb/testsuite/gdb.xml/tdesc-reload.exp
index 21dede88faa..b8ece6fc19c 100644
--- a/gdb/testsuite/gdb.xml/tdesc-reload.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-reload.exp
@@ -29,9 +29,9 @@ if {![runto_main]} {
}
# Three files we're going to write out to.
-set xml_file_1 [standard_output_file outfile1.xml]
-set xml_file_2 [standard_output_file outfile2.xml]
-set xml_file_3 [standard_output_file outfile3.xml]
+set xml_file_1 [host_standard_output_file outfile1.xml]
+set xml_file_2 [host_standard_output_file outfile2.xml]
+set xml_file_3 [host_standard_output_file outfile3.xml]
# Write the current target description to a file.
gdb_test_no_output "pipe maint print xml-tdesc | cat > $xml_file_1" \
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 111a158e7ce..0a0ae697d1e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -6364,6 +6364,16 @@ proc standard_output_file {basename} {
return [file join $dir $basename]
}
+# Turn BASENAME into a file name on host.
+
+proc host_standard_output_file { basename } {
+ if { [is_remote host] } {
+ return $basename
+ } else {
+ return [standard_output_file $basename]
+ }
+}
+
# Turn BASENAME into a full file name in the standard output directory. If
# GDB has been launched more than once then append the count, starting with
# a ".1" postfix.
--
2.35.3
next prev parent reply other threads:[~2023-03-21 10:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 10:25 [pushed 0/2] [gdb/testsuite] Fix gdb.xml/*.exp " Tom de Vries
2023-03-21 10:25 ` Tom de Vries [this message]
2023-03-21 10:25 ` [pushed 2/2] [gdb/testsuite] Fix gdb.xml/tdesc-regs.exp " Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230321102553.14895-2-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).