This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 1/3] Linespec rewrite: Parsing


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]