From patchwork Wed May 24 16:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 69983 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B83BF3836E98 for ; Wed, 24 May 2023 16:41:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B83BF3836E98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684946461; bh=Di0gUk2slZqejb5n365YpPY36eOtY9J1QEvgJtq9H5g=; h=Date:Subject:References:In-Reply-To:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jHkOZr5Bfu1c07TRJ+d+FDNfy3zX6lJuLXZ/pbFjuLUnTQs5SgNnoxGzPDH8To29S IT3BT3O6Ru3tz7mUYJw93mI68cnOOCS4DwRJcdj9EokWyIiomqCmmO4RgfFWrW8XQJ cBgazn6qjWjVkN5Rn/xHTwf3o2iYN5+Y2EIt/cWY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-76c5a225388so32011039f.1 for ; Wed, 24 May 2023 09:37:33 -0700 (PDT) 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) 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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