public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tromey@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] Ensure all DAP requests are keyword-only
Date: Fri, 10 Feb 2023 14:03:24 -0700	[thread overview]
Message-ID: <877cwpxmg3.fsf@tromey.com> (raw)
In-Reply-To: <465ac384-7823-cc84-6e84-c34501db1071@simark.ca> (Simon Marchi's message of "Fri, 10 Feb 2023 15:57:58 -0500")

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> -def set_breakpoint(source, *, breakpoints=[], **args):
>> +def set_breakpoint(*, source, breakpoints=[], **args):
>> if "path" not in source:
>> result = []
>> else:

Simon> IIUC , this function is called magically when receiving a setBreakpoints
Simon> request, and "source" comes from the request arguments?

Yes, that's right.  server.py does:

            body = _commands[params["command"]](**args)

Now, in theory it's possible to just call functions like this directly
from some other python code.  However, I think we should generally
prohibit this, and if it's needed, refactor to have some helper
function, to avoid combining protocol-layer code with implementation
code.

Simon> If so, the change makes sense to me, as there are no positional
Simon> arguments in DAP requests.

Thanks, I'm going to check it in.

Tom

      reply	other threads:[~2023-02-10 21:03 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
2023-02-10 21:03   ` Tom Tromey [this message]

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=877cwpxmg3.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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).