From: Ronan Desplanques Date: Mon, 1 Dec 2025 14:27:37 +0000 (+0100) Subject: DAP: accept requests with '"arguments": null' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d00a99716d3f3a402346261e9587d38372da32af;p=thirdparty%2Fbinutils-gdb.git DAP: accept requests with '"arguments": null' 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. --- diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py index 98a80842633..bc56a721e98 100644 --- a/gdb/python/lib/gdb/dap/server.py +++ b/gdb/python/lib/gdb/dap/server.py @@ -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 = {}