[Lldb-commits] [PATCH] Exception registers aren't supported outside of Darwin

Vince Harron vince at nethacker.com
Thu Apr 2 18:28:28 PDT 2015


Hi clayborg,

Updated test for that

http://reviews.llvm.org/D8812

Files:
  test/python_api/lldbutil/iter/TestRegistersIterator.py

Index: test/python_api/lldbutil/iter/TestRegistersIterator.py
===================================================================
--- test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -19,7 +19,6 @@
         self.line1 = line_number('main.cpp', '// Set break point at this line.')
 
     @expectedFailureFreeBSD # llvm.org/pr14600 - Exception state registers not supported on FreeBSD
-    @expectedFailureLinux # llvm.org/pr14600 - Exception state registers not supported on Linux
     @python_api_test
     def test_iter_registers(self):
         """Test iterator works correctly for lldbutil.iter_registers()."""
@@ -68,21 +67,29 @@
                             print "%s => %s" % (reg.GetName(), reg.GetValue())
 
                     REGs = lldbutil.get_ESRs(frame)
-                    num = len(REGs)
-                    if self.TraceOn():
-                        print "\nNumber of exception state registers: %d" % num
-                    for reg in REGs:
-                        self.assertTrue(reg)
+                    if "darwin" in sys.platform:
+                        num = len(REGs)
                         if self.TraceOn():
-                            print "%s => %s" % (reg.GetName(), reg.GetValue())
+                            print "\nNumber of exception state registers: %d" % num
+                        for reg in REGs:
+                            self.assertTrue(reg)
+                            if self.TraceOn():
+                                print "%s => %s" % (reg.GetName(), reg.GetValue())
+                    else:
+                        self.assertIsNone(REGs)
 
                     # And these should also work.
                     for kind in ["General Purpose Registers",
-                                 "Floating Point Registers",
-                                 "Exception State Registers"]:
+                                 "Floating Point Registers"]:
                         REGs = lldbutil.get_registers(frame, kind)
                         self.assertTrue(REGs)
 
+                    REGs = lldbutil.get_registers(frame, "Exception State Registers")
+                    if "darwin" in sys.platform:
+                        self.assertIsNotNone(REGs)
+                    else:
+                        self.assertIsNone(REGs)
+
                     # We've finished dumping the registers for frame #0.
                     break

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8812.23192.patch
Type: text/x-patch
Size: 2471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150403/77d532b1/attachment.bin>


More information about the lldb-commits mailing list