This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]