From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id A8E1E3858414; Fri, 10 Feb 2023 21:09:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8E1E3858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676063360; bh=/kvxiCvNn5qTLJrgrAykY5aGsGpms1BE5oct8y3ylPk=; h=From:To:Subject:Date:From; b=lwqC3icIu6flXd2a2N9i6NmLKxcbHXA/4cWNkr5mJIiRBteoKPsN+ajrDTWgPIXh6 cNkCyTWXZeggw5HMRq0v+cV/ErSU+lkPz7P+LC2H8DSUJT4mvQUq1YZZqOomwJz7PU oJqbunBUveF5ZeDYzI4AlN27X/pc9dMPKLDwh0Kw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Ensure all DAP requests are keyword-only X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 71bb560755cad815f5159170822cb66df71f916f X-Git-Newrev: 5036bde964bc1a18282dde536a95aecd0d2c08fb Message-Id: <20230210210920.A8E1E3858414@sourceware.org> Date: Fri, 10 Feb 2023 21:09:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5036bde964bc= 1a18282dde536a95aecd0d2c08fb commit 5036bde964bc1a18282dde536a95aecd0d2c08fb Author: Tom Tromey Date: Fri Feb 10 11:59:03 2023 -0700 Ensure all DAP requests are keyword-only =20 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. Diff: --- 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. =20 # 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): =20 =20 @request("setBreakpoints") -def set_breakpoint(source, *, breakpoints=3D[], **args): +def set_breakpoint(*, source, breakpoints=3D[], **args): if "path" not in source: result =3D [] else: @@ -108,7 +108,7 @@ def set_breakpoint(source, *, breakpoints=3D[], **args): =20 @request("setFunctionBreakpoints") @capability("supportsFunctionBreakpoints") -def set_fn_breakpoint(breakpoints, **args): +def set_fn_breakpoint(*, breakpoints, **args): specs =3D [] for bp in breakpoints: specs.append( diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/ev= aluate.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. =20 # 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=3DNone, **args): +def eval_request(*, expression, frameId=3DNone, **args): result =3D send_gdb_with_response(lambda: _evaluate(expression, frameI= d)) return { "result": result,