[Lldb-commits] [PATCH] Don't require AVX registers if the target CPU doesn't have them
Vince Harron
vharron at google.com
Mon Mar 9 21:15:29 PDT 2015
Asserting the presence/absence of AVX registers based on target capabilities
http://reviews.llvm.org/D8189
Files:
test/tools/lldb-server/TestLldbGdbServer.py
Index: test/tools/lldb-server/TestLldbGdbServer.py
===================================================================
--- test/tools/lldb-server/TestLldbGdbServer.py
+++ test/tools/lldb-server/TestLldbGdbServer.py
@@ -461,7 +461,20 @@
self.buildDwarf()
self.qRegisterInfo_contains_at_least_one_register_set()
- def qRegisterInfo_contains_avx_registers_on_linux_x86_64(self):
+ def targetHasAVX(self):
+ # Need to do something different for non-Linux/Android targets
+ if lldb.remote_platform:
+ self.runCmd('platform get-file "/proc/cpuinfo" "cpuinfo"')
+ cpuinfo_path = "cpuinfo"
+ else:
+ cpuinfo_path = "/proc/cpuinfo"
+
+ f = open(cpuinfo_path, 'r')
+ cpuinfo = f.read()
+ f.close()
+ return " avx " in cpuinfo
+
+ def qRegisterInfo_contains_avx_registers(self):
server = self.connect_to_debug_monitor()
self.assertIsNotNone(server)
@@ -482,18 +495,14 @@
# Collect all generics found.
register_sets = { reg_info['set']:1 for reg_info in reg_infos if 'set' in reg_info }
- self.assertTrue("Advanced Vector Extensions" in register_sets)
+ self.assertEquals(self.targetHasAVX(), "Advanced Vector Extensions" in register_sets)
@llgs_test
@dwarf_test
- def test_qRegisterInfo_contains_avx_registers_on_linux_x86_64_llgs_dwarf(self):
- # Skip this test if not Linux x86_64.
- if platform.system() != "Linux" or platform.processor() != "x86_64":
- self.skipTest("linux x86_64 test")
-
+ def test_qRegisterInfo_contains_avx_registers_llgs_dwarf(self):
self.init_llgs_test()
self.buildDwarf()
- self.qRegisterInfo_contains_avx_registers_on_linux_x86_64()
+ self.qRegisterInfo_contains_avx_registers()
def qThreadInfo_contains_thread(self):
procs = self.prep_debug_monitor_and_inferior()
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8189.21544.patch
Type: text/x-patch
Size: 1939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150310/19099e7c/attachment.bin>
More information about the lldb-commits
mailing list