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: Yao Qi <qiyaoltc at gmail dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, Martin Galvan <martin dot galvan at tallertechnologies dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 23 Jun 2015 17:28:49 +0100
- 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>
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.
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.
--
Yao (éå)