This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH] testsuite: Escape a loose '[' character inside a regexp.
- From: Doug Evans <dje at google dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Martin Galvan <martin dot galvan at tallertechnologies dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 23 Jun 2015 11:43:18 -0500
- Subject: Re: [PING][PATCH] testsuite: Escape a loose '[' character inside a regexp.
- Authentication-results: sourceware.org; auth=none
- References: <1434775646-2625-1-git-send-email-martin dot galvan at tallertechnologies dot com> <86bng8rtva dot fsf at gmail dot com> <CADPb22TQonBn5rJrxyv-QL0OzgzXsH2-fLvkrnWBsAi5SDVk-A at mail dot gmail dot com> <86vbeeqtha dot fsf at gmail dot com>
On Tue, Jun 23, 2015 at 11:28 AM, Yao Qi <qiyaoltc@gmail.com> wrote:
> Doug Evans <dje@google.com> writes:
>
>> Generally [ is escaped to avoid Tcl treating it as a subexpression to evaluate.
>> But the escaping isn't needed if the string is wrapped in {} braces
>> which is the case here. Thus to me it feels like it's all the other
>> escaped brackets that need to be fixed (by changing \[ \] to [ ]).
>>
>> OTOH, if one carried that through to completion it would
>> involve a *lot* of changes. help.exp is replete with them.
>> So for now I think the thing to do is apply this patch,
>> *and* add a comment somewhere (the function comment
>> for gdb_test?) documenting that [ == \[.
>
> [ and \[ may be used everywhere in the testsuite, so I don't know how
> much useful that we add comment that [ == \[ for gdb_test. Nobody will
> realise such difference is documented in the gdb_test comment.
That's not a reason to not document it at all.
If I can't something to the code I'll add a note to the wiki.
> I agree that it is impractical to change every \[ to [, but in this
> patch, I am inclined to do the change in the reversed direction, which
> is to change \[ to [ within proc test_class_help.
Fine by me.