public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: Pedro Alves <pedro@palves.net>,
	Andrew Burgess <aburgess@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v2 1/3] gdb: Make global feature array a per-remote target array
Date: Wed, 27 Apr 2022 13:55:16 +0000	[thread overview]
Message-ID: <DM5PR11MB201253E8BC81A11A5F4AAFB3F9FA9@DM5PR11MB2012.namprd11.prod.outlook.com> (raw)
In-Reply-To: <08fd8bbf-c44e-7313-d7b3-7b0770c2c7d4@palves.net>

Hi Pedro and Andrew,

Thanks a lot for identifying and fixing the regression and thank you for the review. 

I added my comments for Pedro's review below.  It would be great if you could briefly review
my new suggestion for the logging.


> I'm not 100% sure about the solution here.
> 
> What is the reasoning for making "set remote foo" affect future connections
> in addition to the current connection?  I didn't see a discussion about that,
> and it seems counterintuitive to me offhand.  I would think that:
> 
>  - if connected, the set command affects the current connection.
> 
>  - if not connected, the set command affects future connections.
> 
> ... would be the simplest solution.  Thus, if the inferior you have selected is
> connected and you want to configure future connections, you'd first drop
> the connection, or switch to an inferior that is not connected.
>

I think the reason why I did not investigate this approach further is because these "set remote"
commands applied to future connections before and  I did not want to change that.
My initial patch did not add any logging for the set remote commands and the user would not
have noticed that the configuration does not apply to  future targets anymore (if connected).
But with the appropriate logging it should be clear and the user should be warned.  So I don't
have any preferences anymore and would go ahead to adapt the patch to Pedro's suggestion,
if there are no further arguments against it. 

> Also, I think it would be better if both the set and the show commands used
> the same wording.  Currently you have, when not connected:
> 
>  (gdb) set remote X-packet off
>  Use of the 'p' packet for future remote targets is set to "off".
>  (gdb) show remote X-packet
>  Support for the 'p' packet on newly created remote targets is "disabled".
> 
> Note the
>  "Use of" vs "Support for",
> and the
>  "for future remote targets", vs "on newly created remote targets".
> 
> Also note that "disabled" is not accepted by the "set command", while
> printing it in quotes suggests that it would.  I mean, note:
> 
> Current master:
> 
>  (gdb) show remote X-packet
>  Support for the `p' packet is currently disabled.
> 
> (no quotes around disabled)
> 
> vs your patches:
> 
>  (gdb) show remote X-packet
>  Support for the 'p' packet on newly created remote targets is "disabled".
> 
> and of course:
> 
>  (gdb) set remote X-packet disabled
>  "on", "off" or "auto" expected.
> 

Yes, you are right.

So I now would suggest the following logging for the packet configuration commands
(based on Pedro's suggestion for the new packet configuration):

~~~
(gdb) set remote kill-packet 
"on", "off" or "auto" expected.
(gdb) show remote kill-packet
Support for the 'vKill' packet on future remote targets is "auto", currently unknown.
(gdb) set remote kill-packet off
Support for the 'vKill' packet on future remote targets is set to "off".
(gdb) show remote kill-packet
Support for the 'vKill' packet on future remote targets is "off".
(gdb) target extended-remote :1234
Remote debugging using :1234
(gdb) set remote kill-packet on
Support for the 'vKill' packet on the current remote target is set to "on". 
(gdb) show remote kill-packet
Support for the 'vKill' packet on the current remote target is "on". 
~~~~
So the only difference between the logging for the show and the set commands, is that
for set we log "is set to" instead of "is".


And for the memory read and write configuration of patch (2/3):

~~~~
(gdb) set remote memory-read-packet-size 
Argument required (integer, "fixed" or "limited').
(gdb) show remote memory-read-packet-size
The memory-read-packet-size on future remote targets is 0 (default). The actual limit will be further reduced dependent on the target.
(gdb) set remote memory-read-packet-size fixed
Future targets may not be able to correctly handle a memory-read-packet-size
of 16384 bytes.  Change the packet size for future remote targets? (y or n) y
The memory-read-packet-size on future remote targets is set to "fixed".
(gdb) show remote memory-read-packet-size
The memory-read-packet-size on future remote targets is 0 (default). Packets are fixed at 16384 bytes.
(gdb) target extended-remote :1234
Remote debugging using :1234 
(gdb) set remote memory-read-packet-size 16300
The memory-read-packet-size on the current remote targets is set to 16300.
(gdb) show remote memory-read-packet-size
The memory-read-packet-size on the current remote target is 16300. Packets are fixed at 16300 bytes.
~~~~

Note that the configuration options before were shown as
~~~~
(gdb) set remote memory-read-packet-size 
Argument required (integer, `fixed' or `limited').
~~~~

I also noted a small issue in the configuration for the "limited" option:
~~~~
(gdb) set remote memory-read-packet-size
Argument required (integer, `fixed' or `limited').
(gdb) set remote memory-read-packet-size limited
Invalid memory-read-packet-size (bad syntax).
(gdb) set remote memory-read-packet-size limit
(gdb)
~~~~
So currently you need to specify "limit" although "limited" is suggested. I would adapt it to "limited" in the v3.

> 
> > +/* Convert the target type (future remote target or currently connected
> target)
> > +   to a name used for gdb printing.  */
> > +
> > +static const char *
> > +get_target_type_name (bool target_connected) {
> > +  if (target_connected)
> > +    return "on the current remote target";
> > +  else
> > +    return "on newly created remote targets"; }
> 
> Note this is not i18n friendly.
> 

Ah yes, I will adapt it in the v3, thanks.


Best Regards,
Christina

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  parent reply	other threads:[~2022-04-27 13:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 13:11 [PATCH v2 0/3] Apply fixme notes for multi-target support Christina Schimpe
2022-03-29 13:11 ` [PATCH v2 1/3] gdb: Make global feature array a per-remote target array Christina Schimpe
2022-03-29 13:45   ` Eli Zaretskii
2022-04-18 14:56   ` Tom Tromey
2022-04-18 19:01   ` Pedro Alves
2022-04-20 11:30     ` "show remote foo-packet" regression (Re: [PATCH v2 1/3] gdb: Make global feature array a per-remote target array) Pedro Alves
2022-04-20 11:31     ` Pedro Alves
2022-04-21 10:25       ` Andrew Burgess
2022-04-21 10:31         ` Pedro Alves
2022-04-21 11:01           ` Andrew Burgess
2022-04-21 16:28             ` Andrew Burgess
2022-04-21 18:20               ` Pedro Alves
2022-04-27 13:55     ` Schimpe, Christina [this message]
2022-05-25 14:27       ` [PATCH v2 1/3] gdb: Make global feature array a per-remote target array Pedro Alves
2022-06-01 10:45         ` Schimpe, Christina
2022-03-29 13:11 ` [PATCH v2 2/3] gdb: Add per-remote target variables for memory read and write config Christina Schimpe
2022-03-29 13:48   ` Eli Zaretskii
2022-04-18 14:56   ` Tom Tromey
2022-03-29 13:11 ` [PATCH v2 3/3] gdb: Remove workaround for the vCont packet Christina Schimpe
2022-04-18 14:59   ` 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=DM5PR11MB201253E8BC81A11A5F4AAFB3F9FA9@DM5PR11MB2012.namprd11.prod.outlook.com \
    --to=christina.schimpe@intel.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /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).