[Lldb-commits] [lldb] [lldb] Don't call AddRemoteRegisters if the target XML did not include any registers (PR #96907)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 27 06:39:48 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r e9b8cd0c806db00f0981fb36717077c941426302...25905a0f01c126dbebc854affd30d9ff838f259b lldb/test/API/functionalities/gdb_remote_client/TestGDBServerNoTargetXMLRegisters.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- TestGDBServerNoTargetXMLRegisters.py	2024-06-27 13:12:32.000000 +0000
+++ TestGDBServerNoTargetXMLRegisters.py	2024-06-27 13:39:18.296302 +0000
@@ -13,10 +13,11 @@
 from lldbsuite.test.gdbclientutils import *
 from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase
 
 import binascii
 from textwrap import dedent
+
 
 class MyResponder(MockGDBServerResponder):
     @staticmethod
     def filecheck_to_blob(fc):
         for l in fc.strip().splitlines():
@@ -39,16 +40,21 @@
     def haltReason(self):
         return self.halt_reason
 
     def qXferRead(self, obj, annex, offset, length):
         if self.has_target_xml and annex == "target.xml":
-            return dedent(f"""\
+            return (
+                dedent(
+                    f"""\
           <?xml version="1.0"?>
           <target version="1.0">
             <architecture>{self.architecture}</architecture>
-          </target>"""), False
-        
+          </target>"""
+                ),
+                False,
+            )
+
         return None, False
 
 
 class TestGDBServerTargetXML(GDBRemoteTestBase):
     def check_x86_64_regs(self, has_target_xml):
@@ -369,15 +375,15 @@
 
     @skipIfRemote
     @skipIfLLVMTargetMissing("X86")
     def test_i386_regs_no_target_xml(self):
         """Test grabbing various i386 registers from gdbserver when there is
-           no target XML."""
+        no target XML."""
         self.check_i386_regs(False)
 
     @skipIfXmlSupportMissing
     @skipIfRemote
     @skipIfLLVMTargetMissing("X86")
     def test_i386_regs_no_register_info(self):
         """Test grabbing various i386 registers from gdbserver when there is
-           target XML but it does not include register info."""
+        target XML but it does not include register info."""
         self.check_i386_regs(True)

``````````

</details>


https://github.com/llvm/llvm-project/pull/96907


More information about the lldb-commits mailing list