[Lldb-commits] [PATCH] D91922: [lldb] Fix qRegisterInfo to handle missing registers

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Nov 21 13:19:46 PST 2020


mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.

Fix qRegisterInfo tests to handle Exx error response when querying
registers that are not supported on the platform in question.  This
is how FreeBSD and NetBSD platforms reporting missing registers right
now, and there certainly is value from verifying the remaining
registers.

This change fixes the test for FreeBSD but NetBSD has other regressions
that still need to be researched.


https://reviews.llvm.org/D91922

Files:
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py


Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===================================================================
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -585,9 +585,14 @@
             p_response = context.get("p_response")
             self.assertIsNotNone(p_response)
 
+            # Skip erraneous (unsupported) registers.
+            if p_response.startswith("E") and len(p_response) == 3:
+                continue
+
             if "dynamic_size_dwarf_expr_bytes" in reg_info:
                 self.updateRegInfoBitsize(reg_info, byte_order)
-            self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
+            self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8,
+                             reg_info)
 
             # Increment loop
             reg_index += 1
@@ -601,7 +606,7 @@
         self.set_inferior_startup_launch()
         self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-    @expectedFailureAll(oslist=["freebsd", "netbsd"])
+    @expectedFailureAll(oslist=["netbsd"])
     @llgs_test
     def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
             self):
@@ -619,7 +624,7 @@
         self.set_inferior_startup_attach()
         self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-    @expectedFailureAll(oslist=["freebsd", "netbsd"])
+    @expectedFailureAll(oslist=["netbsd"])
     @llgs_test
     def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
             self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91922.306871.patch
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201121/a2f12166/attachment.bin>


More information about the lldb-commits mailing list