public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Farre <simon.farre.cx@gmail.com>
Subject: Re: [PATCH v2] gdb/dap - Add support for additional target types
Date: Tue, 13 Jun 2023 12:32:50 -0600	[thread overview]
Message-ID: <87a5x35i25.fsf@tromey.com> (raw)
In-Reply-To: <20230613120628.49014-1-simon.farre.cx@gmail.com> (Simon Farre via Gdb-patches's message of "Tue, 13 Jun 2023 14:06:28 +0200")

>>>>> "Simon" == Simon Farre via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> Adds support for extended-remote configuration. Initial work
Simon> was really just adding 2-3 lines that checked for extended-remote
Simon> but I figured this design makes it trivial to add the remaining target
Simon> types and this design also is self-documenting.

Extensions are documented in the manual, so this should patch that as
well.

Simon> +# To add targets in the future: add required parameters set to their type
Simon> +target_type_requirements = {}
Simon> +target_type_requirements["remote"] = {"address"}
Simon> +target_type_requirements["extended-remote"] = {"address"}

I don't really understand this part of the implementation.

However, I was wondering if we really want to bother with all this.
Perhaps instead we should just have the clients pass any old "target"
argument as a string and have gdb invoke '"target " + client_string'.
I guess I don't see a whole lot of value in trying to separate out the
various parameters somehow.

Simon> +@request("attach")
Simon> +def attach(
Simon> +    *,
Simon> +    pid: Optional[int] = None,
Simon> +    target: Optional[dict] = None,
Simon> +    **args
Simon> +):
Simon> +    # Ensure configurationDone does not try to run (in launch.py)
Simon> +    global _program
Simon> +    _program = None

I don't think this will work properly.
However if we go with the "simple string" approach then the code would
be as simple, or simpler, and could just remain where it is.

Tom

  reply	other threads:[~2023-06-13 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 12:06 Simon Farre
2023-06-13 18:32 ` Tom Tromey [this message]
2023-06-14 10:54   ` Simon Farre
2023-06-14 11:56     ` Andrew Burgess
2023-06-14 12:01       ` Simon Farre
2023-06-20 10:00 Simon Farre
2023-06-20 14:02 ` 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=87a5x35i25.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.farre.cx@gmail.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).