aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-02-07 12:46:22 -0700
committerTom Tromey <tromey@adacore.com>2024-02-21 14:55:22 -0700
commita4af05ca661f8feb1cbb671d4e4e5e8902892f45 (patch)
tree067f4aa1e07adca6fe29d8ab99da05a1568f9566 /gdb/python
parentfddee222e574dfb0f2ba9ecdc4fb1b5db13bfae9 (diff)
downloadgdb-a4af05ca661f8feb1cbb671d4e4e5e8902892f45.zip
gdb-a4af05ca661f8feb1cbb671d4e4e5e8902892f45.tar.gz
gdb-a4af05ca661f8feb1cbb671d4e4e5e8902892f45.tar.bz2
Don't allow multiple request registrations in DAP
This changes the DAP code to check that a given request or capability is only registered a single time. This is just a precaution against accidentally introducing a second definition of a request somewhere.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/dap/server.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index e711066..6757f29 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -355,6 +355,7 @@ def request(
cmd = _check_not_running(cmd)
global _commands
+ assert name not in _commands
_commands[name] = cmd
return cmd
@@ -367,6 +368,7 @@ def capability(name, value=True):
def wrap(func):
global _capabilities
+ assert name not in _capabilities
_capabilities[name] = value
return func