[Lldb-commits] [lldb] [lldb][test] Remove `self` references from decorators (PR #72416)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 15 13:02:43 PST 2023


================
@@ -1310,82 +1308,29 @@ def isAArch64Windows(self):
 
     def getArchitecture(self):
         """Returns the architecture in effect the test suite is running with."""
-        module = builder_module()
-        arch = module.getArchitecture()
-        if arch == "amd64":
-            arch = "x86_64"
-        if arch in ["armv7l", "armv8l"]:
-            arch = "arm"
-        return arch
+        return lldbplatformutil.getArchitecture()
 
     def getLldbArchitecture(self):
         """Returns the architecture of the lldb binary."""
-        if not hasattr(self, "lldbArchitecture"):
-            # These two target settings prevent lldb from doing setup that does
-            # nothing but slow down the end goal of printing the architecture.
-            command = [
-                lldbtest_config.lldbExec,
-                "-x",
-                "-b",
-                "-o",
-                "settings set target.preload-symbols false",
-                "-o",
-                "settings set target.load-script-from-symbol-file false",
-                "-o",
-                "file " + lldbtest_config.lldbExec,
-            ]
-
-            output = check_output(command)
-            str = output.decode()
-
-            for line in str.splitlines():
-                m = re.search(r"Current executable set to '.*' \((.*)\)\.", line)
-                if m:
-                    self.lldbArchitecture = m.group(1)
-                    break
-
-        return self.lldbArchitecture
+        return lldbplatformutil.getLldbArchitecture()
----------------
medismailben wrote:

```suggestion
        return lldbplatformutil.getLLDBArchitecture()
```

https://github.com/llvm/llvm-project/pull/72416


More information about the lldb-commits mailing list