[Lldb-commits] [PATCH] D133366: [lldb] Fix SBFileSpec.fullpath for Windows

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 11 16:07:51 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5223366416fb: [lldb] Fix SBFileSpec.fullpath for Windows (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133366/new/

https://reviews.llvm.org/D133366

Files:
  lldb/bindings/interface/SBFileSpec.i
  lldb/test/API/python_api/file_spec/TestFileSpecAPI.py


Index: lldb/test/API/python_api/file_spec/TestFileSpecAPI.py
===================================================================
--- /dev/null
+++ lldb/test/API/python_api/file_spec/TestFileSpecAPI.py
@@ -0,0 +1,15 @@
+import lldb
+import os
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestCase(TestBase):
+    NO_DEBUG_INFO_TESTCASE = True
+
+    def test_full_path(self):
+        file_spec = lldb.SBFileSpec()
+        file_spec.SetDirectory("a")
+        file_spec.SetFilename("b")
+        self.assertEqual(file_spec.fullpath, os.path.join("a", "b"))
Index: lldb/bindings/interface/SBFileSpec.i
===================================================================
--- lldb/bindings/interface/SBFileSpec.i
+++ lldb/bindings/interface/SBFileSpec.i
@@ -88,7 +88,7 @@
             spec_dir = self.GetDirectory()
             spec_file = self.GetFilename()
             if spec_dir and spec_file:
-                return '%s/%s' % (spec_dir, spec_file)
+                return os.path.join(spec_dir, spec_file)
             elif spec_dir:
                 return spec_dir
             elif spec_file:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133366.474884.patch
Type: text/x-patch
Size: 1184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221112/dad898cf/attachment.bin>


More information about the lldb-commits mailing list