Don't allow multiple request registrations in DAP
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
fail
|
Testing failed
|
Commit Message
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(+)
Comments
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.
>>>>> "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
@@ -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