[PATCH 15/25] Fix a latent bug in DAP request decorator
Tom Tromey
tromey@adacore.com
Wed May 24 16:37:06 GMT 2023
The 'request' decorator is intended to also ensure that the request
function runs in the DAP thread. However, the unwrapped function is
installed in the global request map, so the wrapped version is never
called. This patch fixes the bug.
---
gdb/python/lib/gdb/dap/server.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index f27fa9caa4f..8abe475b031 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -164,9 +164,10 @@ def request(name):
def wrap(func):
global _commands
- _commands[name] = func
# All requests must run in the DAP thread.
- return in_dap_thread(func)
+ func = in_dap_thread(func)
+ _commands[name] = func
+ return func
return wrap
--
2.40.0
More information about the Gdb-patches
mailing list