From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 3EDDF3858D38 for ; Tue, 13 Jun 2023 18:32:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3EDDF3858D38 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-xd30.google.com with SMTP id ca18e2360f4ac-77acb04309dso342349239f.2 for ; Tue, 13 Jun 2023 11:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1686681171; x=1689273171; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FrkGj5oo3p6ySqXHfhbWSHGs7mnjhJbHO6lwFoD1HOQ=; b=bdbMR9wzCSzbVcLN8dMB/uwTBddTmw3SCx7uxrWkwawlaB0qFfwnF4vHl/5EP6tUMq pVeZa1zleJ4wSInMyh82QDopv+PAxlvjDm9F19zdAXgDzXyC+V3D9X/bXbwoGSmPQKpU cqRI06693+pknDFtxyHT87Y1JB8KRd7KJCJCuOY3mhYGfJm3ZuCCcHFnzbm4MKg79//0 MOuJv5szV5iWKHRoymwGfEo2UGU+IzLvkwsBJpMYVhSAiExhRZ1hg5aucMo3VYw7tH6X 8ox0UjpQizD7hgnqn+TboacCpSeJRNoJJfagtvOxyKvHCBct/6yBUFqZgKfU1v/FuLKb WdHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686681171; x=1689273171; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FrkGj5oo3p6ySqXHfhbWSHGs7mnjhJbHO6lwFoD1HOQ=; b=S46oi1mQ7uFwXi811hik5J5w0p2aGJfZiGCtlLizxkZW+gaH8vk6Uq0a+JdWDnXcF5 mCwNLFpQjxNvIjhtv8K1LBPdkhIEw/fR90o4Qx1Y63Jwp4Ze4f2C165DH4XxNZwPPOeq PhRP38n+RxIdlwMb0i52ld1wkfAmPd6BilpfGsi1gN65aPPUsS8wHeQT7pHLJtN5MeqI T5/6Q2d7P5hJHAMLTJHL9NDrJcAUkynCAHHl+Mbm1IjLfCcqxij7Mp0kbYLoB3GL923l 7emjyGfVhly3exIj4w2/S+Gm3aRfu2+0b64H0OhwFjGlGC/nHYnDLZYUBshy1fuM8g+h bNTg== X-Gm-Message-State: AC+VfDxmHwOIWWn3kEBG5dKOdhUhOwizNLoSUIfstPrQf6Dl9eiK1z+Y xWXqb3g9xPj/hx0MnLBA5ZOm6oWpTXdgOcpnBAMjyw== X-Google-Smtp-Source: ACHHUZ4pUXgj3bTcMYug4Vw9bcQ8jk4x8kqyrUtyqo6uZlQlq/v9cPTNIsgouKw1PUqLO+H6xcinmg== X-Received: by 2002:a5d:9644:0:b0:77a:cfbf:1d8f with SMTP id d4-20020a5d9644000000b0077acfbf1d8fmr13605536ios.13.1686681171522; Tue, 13 Jun 2023 11:32:51 -0700 (PDT) Received: from murgatroyd (75-166-136-83.hlrn.qwest.net. [75.166.136.83]) by smtp.gmail.com with ESMTPSA id y23-20020a02ce97000000b0041f66bf91e6sm3432362jaq.110.2023.06.13.11.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 11:32:51 -0700 (PDT) From: Tom Tromey To: Simon Farre via Gdb-patches Cc: Simon Farre Subject: Re: [PATCH v2] gdb/dap - Add support for additional target types References: <20230613120628.49014-1-simon.farre.cx@gmail.com> X-Attribution: Tom Date: Tue, 13 Jun 2023 12:32:50 -0600 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") Message-ID: <87a5x35i25.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: >>>>> "Simon" == Simon Farre via Gdb-patches 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