[Lldb-commits] [PATCH] Fix TestQuoting on remote targets.

Tamas Berghammer tberghammer at google.com
Tue Mar 3 02:33:28 PST 2015

Comment at: test/settings/quoting/TestQuoting.py:71
@@ -70,1 +70,3 @@
+        if !os.path.isfile('stdout.txt'):
+            platform = self.dbg.GetSelectedPlatform()
I think you can check if we run against a remote platform with this condition:

if lldb.remote_platform:
    # Remote
    # Local

Comment at: test/settings/quoting/TestQuoting.py:74
@@ -71,1 +73,3 @@
+        dst_file_spec = lldb.SBFileSpec('stdout.txt', False)
+        platform.Get(src_file_spec, dst_file_spec);
         with open('stdout.txt', 'r') as f:
chaoren wrote:
> ovyalov wrote:
> > chaoren wrote:
> > > ovyalov wrote:
> > > > Does it work in case of local run? It seems it might read and write data from/into the same file..
> > > I had that concern too, but it works fine on local.
> > I remember I had such issue with platform.Put when source and destination were in the same directory. 
> > To be safe, please give them different names stdout-(local|remote).txt and check on OSX as well.
> I guess we could just check if the file already exists, and if it does, assume local, and skip the Get(). Platform cannot tell if we're local, right? Also, platform doesn't provide any functionality to delete remote files, right?
Platform can remove a file (with the Unlink command) but it is not exposed to the Python interface. If you need it you can expose it easily.



More information about the lldb-commits mailing list