This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Copy file to host if it is remote
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 22 Jul 2013 08:13:14 +0800
- Subject: [PATCH] Copy file to host if it is remote
Hi,
When I fix another issue, I find some MI test fails are caused by using
build file directories on host, like these,
-file-exec-and-symbols
/scratch/yqi/i686-pc-linux-gnu-lite-trunk/mingw32-gdb/gdb/testsuite/gdb.mi/mi-var-cmd^M
^error,msg="/scratch/yqi/i686-pc-linux-gnu-lite-trunk/mingw32-gdb/gdb/testsuite/gdb.mi/mi-var-cmd:
No such file or directory."^M
(gdb) ^M
FAIL: gdb.mi/mi-var-cmd.exp: floating varobj invalidation
-file-exec-and-symbols
/scratch/yqi/i686-pc-linux-gnu-lite-trunk/mingw32-gdb/gdb/testsuite/gdb.mi/mi-basics^M
^error,msg="/scratch/yqi/i686-pc-linux-gnu-lite-trunk/mingw32-gdb/gdb/testsuite/gdb.mi/mi-basics:
No such file or directory."^M
(gdb) ^M
FAIL: gdb.mi/mi-basics.exp: file-exec-and-symbols operation
The fix is to copy file to the host and use ${testfile} if the host is
remote. OK?
gdb/testsuite:
2013-07-22 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi-basics.exp (test_exec_and_symbol_mi_operatons):
If host is remote, copy ${binfile} to host and use
${testfile} on host.
* gdb.mi/mi-var-cmd.exp: Likewise.
---
gdb/testsuite/gdb.mi/mi-basics.exp | 15 +++++++++++----
gdb/testsuite/gdb.mi/mi-var-cmd.exp | 9 ++++++++-
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index c8bb3f7..f4ffa05 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -71,13 +71,20 @@ proc test_mi_interpreter_selection {} {
proc test_exec_and_symbol_mi_operatons {} {
global mi_gdb_prompt
- global binfile
+ global binfile testfile
+
+ if [is_remote host] {
+ set filename ${testfile}
+ remote_download host ${binfile} ${filename}
+ } else {
+ set filename ${binfile}
+ }
# Load symbols and specify executable on a single operation
# Tests:
# -file-exec-and-symbols
- if [mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\\^done" \
+ if [mi_gdb_test "-file-exec-and-symbols ${filename}" "\\\^done" \
"file-exec-and-symbols operation"] {
note "Skipping all other MI tests."
return 0
@@ -98,11 +105,11 @@ proc test_exec_and_symbol_mi_operatons {} {
# "\\\^done" \
# "file-clear operation"
- mi_gdb_test "-file-exec-file ${binfile}" \
+ mi_gdb_test "-file-exec-file ${filename}" \
"\\\^done" \
"file-exec-file operation"
- mi_gdb_test "-file-symbol-file ${binfile}" \
+ mi_gdb_test "-file-symbol-file ${filename}" \
"\\\^done" \
"file-symbol-file operation"
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index 6addea6..6e1d48f 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -558,7 +558,14 @@ mi_gdb_test "-var-update selected_a" \
"\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \
"update selected_a in do_special_tests"
-mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \
+if [is_remote host] {
+ set filename ${testfile}
+ remote_download host ${binfile} ${filename}
+} else {
+ set filename ${binfile}
+}
+
+mi_gdb_test "-file-exec-and-symbols ${filename}" "\\^done" \
"floating varobj invalidation"
mi_delete_varobj selected_a "delete selected_a"
--
1.7.7.6