From: Tom Tromey Date: Thu, 11 May 2023 20:25:07 +0000 (-0600) Subject: Fix a latent bug in DAP request decorator X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c7cdc95aaace0f2eb7a13199a3cbf479617a009;p=binutils-gdb.git 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. --- 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