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 B88853858414 for ; Fri, 10 Feb 2023 19:00:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B88853858414 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 d16so2296481ioz.12 for ; Fri, 10 Feb 2023 11:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ncTgPzZZXsrihlELIXCya77ynGmItJSLAHNP0Ku9NMc=; b=cgteH9fYTPFQS7LD0uwD7vlWcvXIc/xPpDbRk3RMWHu5FUg526pL0rBUmcW52IsLqn H8OKgauB9oN1A8wVuNa9FAptiUyiryTywhGCwagH4Q9za2VyNy4s1XJ5j6Vdwq8whEqG MTV3T4HKhbhh7qS7Vdp/8NXJDvPuatkVDLgp8O3AfjBA04H23ZXXSh3Dz2quu+cA7UUL +EbyzB80dX/a2Yr2nsJBLToc5+qZLSQKuKadaap1fq4XouRr6AThZPFivZ6zPz8VD1Hc ASEjdQYhPCzGpQrS1+ytSc9jksM7WBeTdPrymCY6a55dPqQZZVTo5DoJJv+ycaxkAAR9 BERA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ncTgPzZZXsrihlELIXCya77ynGmItJSLAHNP0Ku9NMc=; b=FYqV/rllIqmyzEgOi/K5JZMAZiGXPTBgFt2WXrqIPnm3s02PneanhgA+oVGor6oKO8 fTU5Zr/MQF0PdNuk4do+kvNzvcV6HDWJkY9DMECovR2O0ZSjlhORN4WKiHU4cWeo6/jD coMT5XUHJYPVvSa4BE4a2QMxeH7Dzo0eZ5SDMQojsp18IZMmUl6W0Q52xkuJbEkkMl7+ 7EJQEQH7GJwF28BQyEcDJUqdjEr5onI/idXnrxtPMqPfx2bZRUqah+1kOfnZ67Zll+sV S3QxFvBhw+4CqQZIDJNlA0/AUP4bZTMtGpj4Jx5bP5ZnKIwhApzlqxpy69BrjdM9+QbK Efyw== X-Gm-Message-State: AO0yUKVlkKfsO+w+tzySbKaXtNl2jJHNsLkdFvXOgtn6FmOfeijvMmyZ hAyMSPOB9XQ16M7Wzp0PJrAFxSVJrxPkS0ZS X-Google-Smtp-Source: AK7set/evMh6KOE539UIUSGB4ddLxPppHJfx6vXjTcLwKi8LxThVYlPLNhdpWp3VmfR64mOZB3Livg== X-Received: by 2002:a05:6602:1506:b0:72b:623a:bc31 with SMTP id g6-20020a056602150600b0072b623abc31mr17992619iow.6.1676055648905; Fri, 10 Feb 2023 11:00:48 -0800 (PST) Received: from localhost.localdomain (75-166-130-93.hlrn.qwest.net. [75.166.130.93]) by smtp.gmail.com with ESMTPSA id j4-20020a6b7804000000b00704c767ead9sm1496693iom.28.2023.02.10.11.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 11:00:48 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Ensure all DAP requests are keyword-only Date: Fri, 10 Feb 2023 12:00:39 -0700 Message-Id: <20230210190039.2221954-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 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 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: 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: @@ -108,7 +108,7 @@ def set_breakpoint(source, *, breakpoints=[], **args): @request("setFunctionBreakpoints") @capability("supportsFunctionBreakpoints") -def set_fn_breakpoint(breakpoints, **args): +def set_fn_breakpoint(*, breakpoints, **args): specs = [] for bp in breakpoints: specs.append( diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py index c05e62d17a3..f01bf0f33c9 100644 --- a/gdb/python/lib/gdb/dap/evaluate.py +++ b/gdb/python/lib/gdb/dap/evaluate.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 @@ -33,7 +33,7 @@ def _evaluate(expr, frame_id): # FIXME return a structured response using pretty-printers / varobj # FIXME supportsVariableType handling @request("evaluate") -def eval_request(expression, *, frameId=None, **args): +def eval_request(*, expression, frameId=None, **args): result = send_gdb_with_response(lambda: _evaluate(expression, frameId)) return { "result": result, -- 2.39.1