From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 31F8D3858414 for ; Fri, 10 Feb 2023 20:57:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31F8D3858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D91AF1E0D3; Fri, 10 Feb 2023 15:57:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1676062678; bh=4IupKNM8XDUYwfnnF7bNFmZ9W/wp1JCu1D+20prEVZs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Nx1zPQ0kAy4QU5AhVtriwgwX/NJcSb18swySBYvw7fzYUDcWzCoEopkRoFufIPonB zJtJnVqyKZbrp6/T7fYDHS5YFxwXpqeEeYSJlAiT2BPIJO9y2LexwIWkICGI/cQ71y T4/T/7RJp2yVi3TjK8HoTQ5sFwBq53ismPyAGBhE= Message-ID: <465ac384-7823-cc84-6e84-c34501db1071@simark.ca> Date: Fri, 10 Feb 2023 15:57:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] Ensure all DAP requests are keyword-only Content-Language: fr To: Tom Tromey , gdb-patches@sourceware.org References: <20230210190039.2221954-1-tromey@adacore.com> From: Simon Marchi In-Reply-To: <20230210190039.2221954-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,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: On 2/10/23 14:00, Tom Tromey via Gdb-patches wrote: > Python functions implementing DAP requests should not use positional > parameters -- it only makes sense to call them with keyword arguments. > This patch changes the few remaining cases to start with the special > "*" parameter, following this rule. > --- > gdb/python/lib/gdb/dap/breakpoint.py | 6 +++--- > gdb/python/lib/gdb/dap/evaluate.py | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py > index 502beb0478e..f0e1f103d1b 100644 > --- a/gdb/python/lib/gdb/dap/breakpoint.py > +++ b/gdb/python/lib/gdb/dap/breakpoint.py > @@ -1,4 +1,4 @@ > -# Copyright 2022 Free Software Foundation, Inc. > +# Copyright 2022, 2023 Free Software Foundation, Inc. > > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > @@ -85,7 +85,7 @@ def _set_breakpoints(kind, specs): > > > @request("setBreakpoints") > -def set_breakpoint(source, *, breakpoints=[], **args): > +def set_breakpoint(*, source, breakpoints=[], **args): > if "path" not in source: > result = [] > else: IIUC , this function is called magically when receiving a setBreakpoints request, and "source" comes from the request arguments? If so, the change makes sense to me, as there are no positional arguments in DAP requests. Simon