This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/3] Linespec rewrite: Parsing
- From: Keith Seitz <keiths at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Mon, 26 Mar 2012 13:35:54 -0700
- Subject: Re: [RFA 1/3] Linespec rewrite: Parsing
- References: <4F67A319.4090608@redhat.com> <877gy788hz.fsf@fleche.redhat.com>
On 03/26/2012 12:31 PM, Tom Tromey wrote:
"Keith" == Keith Seitz<keiths@redhat.com> writes:
Keith> +/* A convenience macro for trimming trailing whitespace
Keith> + from string P. */
We have remove_trailing_whitespace now, see cli-utils.h.
[cough] I even wrote that... I've changed to using it.
Keith> + *(_p + 1) = '\0'; \
I'm curious if this is writing into temporary strings or into the input
string.
This is called from copy_token_string. The string is allocated via
savestring, so it should be safe to modify the string like this.
I ask because I think the module would generally be friendlier if it
were const-correct and did not write into the input strings. This would
make its behavior more predictable. However I didn't audit it to see
whether this is reasonably practical; and the language parsers may throw
a wrench into this idea.
This was a goal. The input stream is never modified. Only a pointer to
it is advanced, just like we do today.
I only skimmed the rest, since:
Keith> I have pushed a patch to my archer branch which permits
Keith> quote-encapsulating the linespec. I have also reverted the
Keith> "invalid" linespec tests.
... I think it is time to send fresh patches.
Will do. [And I will follow Pedro's advice.]
Keith