public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't allow multiple request registrations in DAP
@ 2024-02-07 19:47 Tom Tromey
  2024-02-09 12:04 ` Alexandra Petlanova Hajkova
  2024-02-21 21:11 ` Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2024-02-07 19:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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.
---
 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 7cc5a4681ee..ba139412b90 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -354,6 +354,7 @@ def request(
             cmd = _check_not_running(cmd)
 
         global _commands
+        assert name not in _commands
         _commands[name] = cmd
         return cmd
 
@@ -366,6 +367,7 @@ def capability(name, value=True):
 
     def wrap(func):
         global _capabilities
+        assert name not in _capabilities
         _capabilities[name] = value
         return func
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't allow multiple request registrations in DAP
  2024-02-07 19:47 [PATCH] Don't allow multiple request registrations in DAP Tom Tromey
@ 2024-02-09 12:04 ` Alexandra Petlanova Hajkova
  2024-02-21 21:11 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandra Petlanova Hajkova @ 2024-02-09 12:04 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

On Wed, Feb 7, 2024 at 8:47 PM Tom Tromey <tromey@adacore.com> wrote:

> 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.
>
>
I can confirm this change does not cause any regressions on ppc64le, Fedora
Rawhide.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't allow multiple request registrations in DAP
  2024-02-07 19:47 [PATCH] Don't allow multiple request registrations in DAP Tom Tromey
  2024-02-09 12:04 ` Alexandra Petlanova Hajkova
@ 2024-02-21 21:11 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2024-02-21 21:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Tom> This changes the DAP code to check that a given request or capability
Tom> is only registered a single time.  This is just a precaution against
Tom> accidentally introducing a second definition of a request somewhere.

I'm checking this in.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-21 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07 19:47 [PATCH] Don't allow multiple request registrations in DAP Tom Tromey
2024-02-09 12:04 ` Alexandra Petlanova Hajkova
2024-02-21 21:11 ` 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).