aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2025-12-01 15:27:37 +0100
committerTom Tromey <tromey@adacore.com>2025-12-15 07:28:10 -0700
commitd00a99716d3f3a402346261e9587d38372da32af (patch)
treee2c7e12729fe0dd69c7ff04afe84360d34928730 /gdb/python
parent60a614d2a56dff3c70bde93a93121ea52338b678 (diff)
downloadbinutils-d00a99716d3f3a402346261e9587d38372da32af.zip
binutils-d00a99716d3f3a402346261e9587d38372da32af.tar.gz
binutils-d00a99716d3f3a402346261e9587d38372da32af.tar.bz2
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.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/dap/server.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index 98a8084..bc56a72 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 = {}