]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
DAP: accept requests with '"arguments": null'
authorRonan Desplanques <desplanques@adacore.com>
Mon, 1 Dec 2025 14:27:37 +0000 (15:27 +0100)
committerTom Tromey <tromey@adacore.com>
Mon, 15 Dec 2025 14:28:10 +0000 (07:28 -0700)
Some Debug Adapter Protocol clients like Helix set the optional
"arguments" field of the ConfigurationDone request to null, which is a
bit odd but seems to be allowed by the protocol specification. Before
this patch, Python exceptions would be raised on such requests. This
patch makes it so these requests are treated as if the "arguments"
field was absent.

gdb/python/lib/gdb/dap/server.py

index 98a808426333d91ab705e6f7d8c8353e97461d54..bc56a721e98ed9682239ffb930f87c176fd4b0be 100644 (file)
@@ -312,7 +312,15 @@ class Server:
         }
 
         if "arguments" in params:
-            args = params["arguments"]
+            # Since the "arguments" field is optional, setting it to
+            # null is an odd thing to do when one could simply omit it
+            # entirely. But some clients do just that for some
+            # requests (e.g. Helix for ConfigurationDone), so we
+            # accommodate this case.
+            if params["arguments"] is None:
+                args = {}
+            else:
+                args = params["arguments"]
         else:
             args = {}