Can you rewrite the exe path computation to use os.path.join so we're not assuming posix syntax?<br><div class="gmail_quote"><div dir="ltr">On Tue, May 2, 2017 at 11:11 PM vignesh balu via Phabricator via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vbalu updated this revision to Diff 97550.<br>
vbalu added a comment.<br>
<br>
Corrected the code. Now this test will fail without <a href="https://reviews.llvm.org/D32271" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32271</a> patch.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D32522" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32522</a><br>
<br>
Files:<br>
packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py<br>
<br>
<br>
Index: packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py<br>
===================================================================<br>
--- packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py<br>
+++ packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py<br>
@@ -8,6 +8,7 @@<br>
import os<br>
import time<br>
import lldb<br>
+import shutil<br>
from lldbsuite.test.decorators import *<br>
from lldbsuite.test.lldbtest import *<br>
from lldbsuite.test import lldbutil<br>
@@ -38,6 +39,25 @@<br>
process = target.GetProcess()<br>
self.assertTrue(process, PROCESS_IS_VALID)<br>
<br>
+ def test_attach_to_process_frm_different_dir_by_id(self):<br>
+ """Test attach by process id"""<br>
+ os.mkdir(os.path.join(os.getcwd(),'newdir'))<br>
+ self.buildProgram('main.cpp','newdir/proc_attach')<br>
+ exe = './newdir/proc_attach'<br>
+ self.addTearDownHook(lambda: shutil.rmtree(os.path.join(os.getcwd())))<br>
+<br>
+ # Spawn a new process<br>
+ popen = self.spawnSubprocess(exe)<br>
+ self.addTearDownHook(self.cleanupSubprocesses)<br>
+<br>
+ os.chdir('newdir')<br>
+ self.runCmd("process attach -p " + str(popen.pid))<br>
+<br>
+ target = self.dbg.GetSelectedTarget()<br>
+<br>
+ process = target.GetProcess()<br>
+ self.assertTrue(process, PROCESS_IS_VALID)<br>
+<br>
def test_attach_to_process_by_name(self):<br>
"""Test attach by process name"""<br>
self.build()<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>