From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by sourceware.org (Postfix) with ESMTPS id D2D933857345 for ; Wed, 24 May 2023 16:37:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2D933857345 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-76c5a225388so32011039f.1 for ; Wed, 24 May 2023 09:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1684946253; x=1687538253; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Di0gUk2slZqejb5n365YpPY36eOtY9J1QEvgJtq9H5g=; b=DbdboXHmqIW+b8N0i1N+M18+I3O1ZQSGvDfUxPk0+dkbJCDXfpuowc46k5ifZjWdRk 6FzDPjjC62iF2jUjTj6vol/thiPvLHNWADJMIAETyKll2ObIyTwerWG4LdRuYLtNEvOQ VVe+hng+JrfNhiEyCBAd/lUK6Di01E9Zo79sBw1LTtk9ufGblfZPlKiZVH2HU0vFXvGg lGsPu9cTxfXh5LOedA1PltPYYn1yFrffAqbWr8PwJNwUDUmTp9/V5Znu4QeFqmzznUph hbE5gLMzIJKMaq6M/dl2+LuprdvGUJbbT3PTkjDjUx5j8UhuXnRZUnaYptD3HG4DX6O7 LSaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684946253; x=1687538253; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Di0gUk2slZqejb5n365YpPY36eOtY9J1QEvgJtq9H5g=; b=JVm5g6KiBCCRQTU/v1wP0edwWI+UP1sxZ9VbsPiAv/iwOQmOJEqIacXjYkQ4HcRRd7 8Z3BxkBlGpnXw3rLKu5//iN0am4QZJlvkyM5Fm+fM4pw4RetS3p6Avb+ghWx5a2AayqQ VrkOLAGNHBbVBtdjEsjfWz/sx5f+FSq8FAljR9B96HNTE7FvGACyJNKD0lcRYYDa1Oz/ phXDROmWVLj+tylKsf78tKzlp7jV67m9O75QCDqYxq1THJ0u6lmcizqiczOcUUotuRPr Uv/yH2v3V8Ra08Fs/1OfMCStWP+ceMZDOxUJTBV3MqHZmmwKwOEapsNOveApuPG5YcAc 0XwA== X-Gm-Message-State: AC+VfDxZWOWcrRhNGPY3UhIPmxr8Obl0ca0qFr0uYyxolF16skSdkneb LJDPZS0Tb7GeVkKCCLylcfYJA7It/vfWaWzBtx2PBg== X-Google-Smtp-Source: ACHHUZ66Bt4R8tZlIRr3d0b6oKmNQ74qDX+utX7gEGjdE81n+diSVALsVL1GiCT4qKqpvdaqYOHYTw== X-Received: by 2002:a6b:6203:0:b0:774:9b45:f5ea with SMTP id f3-20020a6b6203000000b007749b45f5eamr441824iog.11.1684946253161; Wed, 24 May 2023 09:37:33 -0700 (PDT) Received: from localhost.localdomain (71-211-130-244.hlrn.qwest.net. [71.211.130.244]) by smtp.gmail.com with ESMTPSA id o22-20020a6bcf16000000b0076c81bf2731sm3397266ioa.20.2023.05.24.09.37.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 09:37:32 -0700 (PDT) From: Tom Tromey Date: Wed, 24 May 2023 10:37:06 -0600 Subject: [PATCH 15/25] Fix a latent bug in DAP request decorator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230427-ada-catch-exception-v1-15-947caa9905e3@adacore.com> References: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com> In-Reply-To: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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