[Lldb-commits] [lldb] 2325b3c - [lldb] Add test for reserved XML chars in register field names

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 24 02:40:10 PDT 2023


Author: David Spickett
Date: 2023-10-24T09:39:44Z
New Revision: 2325b3cfdadf266651294ff469ce600a8ee402ce

URL: https://github.com/llvm/llvm-project/commit/2325b3cfdadf266651294ff469ce600a8ee402ce
DIFF: https://github.com/llvm/llvm-project/commit/2325b3cfdadf266651294ff469ce600a8ee402ce.diff

LOG: [lldb] Add test for reserved XML chars in register field names

Replacements like & were already handled by libXML but we have
no tests to confirm that, this adds some.

Added: 
    

Modified: 
    lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py b/lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
index 9e553c57f39cb7a..e2c75970c2d2ed5 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
@@ -636,3 +636,21 @@ def test_flags_in_register_info(self):
                 "|  C   |  D  |"
             ],
         )
+
+    @skipIfXmlSupportMissing
+    @skipIfRemote
+    def test_flags_name_xml_reserved_characters(self):
+        """Check that lldb converts reserved character replacements like &
+        when found in field names."""
+        self.setup_flags_test(
+            '<field name="E&" start="0" end="0"/>'
+            '<field name="D"" start="1" end="1"/>'
+            '<field name="C'" start="2" end="2"/>'
+            '<field name="B>" start="3" end="3"/>'
+            '<field name="A<" start="4" end="4"/>'
+        )
+
+        self.expect(
+            "register info cpsr",
+            substrs=["| A< | B> | C' | D\" | E& |"],
+        )


        


More information about the lldb-commits mailing list