[review v3] [Debugging output] Make remote packet truncation length adjustable

Pedro Alves (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Thu Nov 21 16:31:00 GMT 2019


Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/691
......................................................................


Patch Set 3:

> > > I'm not too sure packet-length-limit is good. Suggestions are welcome.

I agree "set remote packet-length-limit" isn't good, since I'd expect a setting by that name to control the actual max size of gdb's packet buffer.

> > 
> > I tend to think something in the "set debug" namespace would be better,
> > since it's a setting related to "set debug remote".
> 
> I contemplated that, but upon looking at what sorts of options were available via "set debug", they were related to producing debugging output only, not adjusting how the debugging output was produced. So i went for more locality by putting it into "set remote".
> 
> To be honest, i don't think it fits in any of those two. But i'm okay with going for "set debug remote-log-length" based on feedback.
> 
> > 
> > How about "set debug remote-log-length"?
> > 
> > This patch also needs a documentation change and a NEWS entry.
> 
> I'll put something together.

I'm not thrilled with "remote-log-length" because "length" alone doesn't convey "max", or "limit".
Your original "packet-length-limit" did, but it was under the wrong namespace.

Including "log" in the setting name seems redundant, since "set debug" settings all control logging in some form.

"packet-length-limit" wasn't 100% correct, since it's not really the size of the packet that counts, it's how much you'd display, including escaping, but that seems like a minor issue.

Let's look at how the option is described:

 "Sets the number of characters to display for each remote packet"

Note that it doesn't talk about "log" and doesn't say "length".

If you start from that description, then the obvious setting name would be around:

  set debug remote-max-chars
  set debug remote-packet-max-characters
  set debug remote-packet-max-chars
  set debug remote-max-packet-chars

I think my preferred one would be "remote-packet-max-chars", since the limit only applies to packet logging.

Which is not unlike the existing macro name:

 /* The max number of chars in debug output.  The rest of chars are
    omitted.  */

 #define REMOTE_DEBUG_MAX_CHAR 512


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2e871b37bfcaa6376537c3fe3db8f016dd806a7c
Gerrit-Change-Number: 691
Gerrit-PatchSet: 3
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Pedro Alves <palves@redhat.com>
Gerrit-Comment-Date: Thu, 21 Nov 2019 16:31:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment



More information about the Gdb-patches mailing list