aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-05-11 14:25:07 -0600
committerTom Tromey <tromey@adacore.com>2023-06-12 12:09:28 -0600
commit5c7cdc95aaace0f2eb7a13199a3cbf479617a009 (patch)
tree87bc504fa7a5872e7650ae4e80e4324f4253cc7c
parent070e93a8b86deaa7b4813839698e4771d282af93 (diff)
downloadgdb-5c7cdc95aaace0f2eb7a13199a3cbf479617a009.zip
gdb-5c7cdc95aaace0f2eb7a13199a3cbf479617a009.tar.gz
gdb-5c7cdc95aaace0f2eb7a13199a3cbf479617a009.tar.bz2
Fix a latent bug in DAP request decorator
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.
-rw-r--r--gdb/python/lib/gdb/dap/server.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index f27fa9c..8abe475 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