[LLDB] Minor fix in TestSVERegisters.py for AArch64/Linux buildbot
authorMuhammad Omair Javaid <omair.javaid@linaro.org>
Wed, 19 Aug 2020 10:47:46 +0000 (15:47 +0500)
committerMuhammad Omair Javaid <omair.javaid@linaro.org>
Wed, 19 Aug 2020 10:47:59 +0000 (15:47 +0500)
This adds a minor test case fix to previously submitted AArch64 SVE
ptrace support. This was failing on LLDB/AArch64 Linux buildbot.

Differential Revision: https://reviews.llvm.org/D79699

lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py

index c34f4ae..42d30f6 100644 (file)
@@ -21,10 +21,16 @@ class RegisterCommandsTestCase(TestBase):
         cpuinfo_path = self.getBuildArtifact("cpuinfo")
         if configuration.lldb_platform_name:
             self.runCmd('platform get-file "/proc/cpuinfo" ' + cpuinfo_path)
+        else:
+            cpuinfo_path = "/proc/cpuinfo"
+
+        try:
+            f = open(cpuinfo_path, 'r')
+            cpuinfo = f.read()
+            f.close()
+        except:
+            return False
 
-        f = open(cpuinfo_path, 'r')
-        cpuinfo = f.read()
-        f.close()
         return " sve " in cpuinfo
 
     def check_sve_register_size(self, set, name, expected):