public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Don't allow multiple request registrations in DAP
@ 2024-02-21 21:56 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-02-21 21:56 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a4af05ca661f8feb1cbb671d4e4e5e8902892f45

commit a4af05ca661f8feb1cbb671d4e4e5e8902892f45
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Feb 7 12:46:22 2024 -0700

    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.

Diff:
---
 gdb/python/lib/gdb/dap/server.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index e7110660741..6757f2921bf 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-21 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21 21:56 [binutils-gdb] Don't allow multiple request registrations in DAP Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).