From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta037.useast.a.cloudfilter.net (omta037.useast.a.cloudfilter.net [44.202.169.36]) by sourceware.org (Postfix) with ESMTPS id 46CC33858D20 for ; Fri, 1 Sep 2023 19:07:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46CC33858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTP id c6IlqHYRnWU1cc9U0qeL9V; Fri, 01 Sep 2023 19:07:04 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id c9TzqvcKG8DMTc9Tzqbln3; Fri, 01 Sep 2023 19:07:04 +0000 X-Authority-Analysis: v=2.4 cv=ZbIOi+ZA c=1 sm=1 tr=0 ts=64f23658 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=zNV7Rl7Rt7sA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=mDV3o1hIAAAA:8 a=6DMZYGI0fhKiabhd-loA:9 a=ul9cdbp4aOFLsgKbc677:22 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=M5Uyo53pSCj+iNKuFQYQ6lojvFdqU5d1u09QUSbrU2o=; b=a3uyQos+6jYanSzOrFPdRuPcMY 5KI28EsCQupCPtCRtI3V9kpZ2wn9rTeQ/B9uVqs4jKR0gX3vv4qN17shCDon2VzPx4WBXd1AIR0JD o8djKkascssZdIG2i6XqLRp1/; Received: from 75-166-150-212.hlrn.qwest.net ([75.166.150.212]:46608 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qc9Tz-000orO-0k; Fri, 01 Sep 2023 13:07:03 -0600 From: Tom Tromey To: Gregory Anders via Gdb-patches Cc: Gregory Anders Subject: Re: [PATCH 2/4] gdb/dap: ignore unused keyword args in step_out References: <20230901180323.22328-3-greg@gpanders.com> <20230901180323.22328-7-greg@gpanders.com> X-Attribution: Tom Date: Fri, 01 Sep 2023 13:07:02 -0600 In-Reply-To: <20230901180323.22328-7-greg@gpanders.com> (Gregory Anders via Gdb-patches's message of "Fri, 1 Sep 2023 12:55:37 -0500") Message-ID: <87sf7xogq1.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.150.212 X-Source-L: No X-Exim-ID: 1qc9Tz-000orO-0k X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-150-212.hlrn.qwest.net (murgatroyd) [75.166.150.212]:46608 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfH2E+P4iBDSukwR/VKYInhnmBjtEDmEYyIOtUTvqyGgWRyBjIjrBxaSDHmA9EwaS17PGF73kcjg7ciKBPMTDDUgb2CdTR5+X/2BU+bwKUvHww8By603U eDGvYX6yB8QLHWqsf/ZvSVXzYh22ERfpdAfjIgxicHkVIhEKexNNrrSjte8bfI8cvsNcn3iLaoSkvLhg5+SHTfwmQ7DWiKwnizM= X-Spam-Status: No, score=-3024.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,TXREP 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: >>>>> "Gregory" == Gregory Anders via Gdb-patches writes: Gregory> Some DAP clients may send additional parameters in the stepOut command Gregory> (e.g. "granularity") which are not used by GDB, but should nonetheless Gregory> be accepted without error. Nice catch, thank you. I came up with the appended to ensure this remains true in the future. I may land this one out of sequence -- we can accept some very small patches without a copyright assignment -- and then the self-check patch afterward. Let me know what you think. Tom diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py index db7893a387b..d84bca5d1fc 100644 --- a/gdb/python/lib/gdb/dap/server.py +++ b/gdb/python/lib/gdb/dap/server.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import inspect import json import queue import sys @@ -165,6 +166,12 @@ def request(name): def wrap(func): global _commands + code = func.__code__ + # We don't permit requests to have positional arguments. + assert code.co_posonlyargcount == 0 + assert code.co_argcount == 0 + # A request must have a **args parameter. + assert code.co_flags & inspect.CO_VARKEYWORDS # All requests must run in the DAP thread. # Also type-check the calls. func = in_dap_thread(type_check(func))