From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Ensure all DAP requests are keyword-only
Date: Fri, 10 Feb 2023 15:57:58 -0500 [thread overview]
Message-ID: <465ac384-7823-cc84-6e84-c34501db1071@simark.ca> (raw)
In-Reply-To: <20230210190039.2221954-1-tromey@adacore.com>
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
next prev parent reply other threads:[~2023-02-10 20:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 19:00 Tom Tromey
2023-02-10 20:57 ` Simon Marchi [this message]
2023-02-10 21:03 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=465ac384-7823-cc84-6e84-c34501db1071@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).