This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
- From: Yao Qi <yao at codesourcery dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 26 Aug 2013 09:59:45 +0800
- Subject: Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
- Authentication-results: sourceware.org; auth=none
- References: <1376427803-16608-1-git-send-email-tromey at redhat dot com> <1376427803-16608-3-git-send-email-tromey at redhat dot com>
On 08/14/2013 05:03 AM, Tom Tromey wrote:
> +# Like remote_download but provides a gdb-specific behavior. If DEST
> +# is "host", and the host is not remote, and TOFILE is not specified,
> +# then the [file tail] of FROMFILE is passed through
> +# standard_output_file to compute the destination.
> +
> +proc gdb_remote_download {dest fromfile {tofile {}}} {
> + if {$dest == "host" && ![is_remote host] && $tofile == ""} {
> + set tofile [standard_output_file [file tail $fromfile]]
> + }
> + return [remote_download $dest $fromfile $tofile]
> +}
> +
Tom,
this change causes regressions in remote-host testing....
(gdb) python exec (open ('').read ())^M
Traceback (most recent call last):^M
File "<string>", line 1, in <module>^M
IOError: [Errno 22] invalid mode ('r') or filename: ''^M
Error while executing Python code.^M
(gdb) FAIL: gdb.python/py-typeprint.exp: python exec (open ('').read ())
The proc gdb_remote_download is invoked like this:
gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py
the tofile is "". Then, remote_donwload is invoke like like
remote_download host ${srcdir}/${subdir}/${testfile}.py ""
In remote_download,
proc remote_download { dest file args } {
if { [llength $args] > 0 } {
set destfile [lindex $args 0]
} else {
set destfile [file tail $file]
}
ARGS length is 1 and destfile is set to "", which is wrong. How about
the patch below?
--
Yao (éå)
gdb/testsuite:
2013-08-26 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (gdb_remote_download): Don't pass $tofile to
remote_download if it is empty.
---
gdb/testsuite/lib/gdb.exp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5456029..fabfa69 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3301,7 +3301,12 @@ proc gdb_remote_download {dest fromfile {tofile {}}} {
if {$dest == "host" && ![is_remote host] && $tofile == ""} {
set tofile [standard_output_file [file tail $fromfile]]
}
- return [remote_download $dest $fromfile $tofile]
+
+ if { $tofile == "" } {
+ return [remote_download $dest $fromfile]
+ } else {
+ return [remote_download $dest $fromfile $tofile]
+ }
}
# gdb_download
--
1.7.7.6