[PING][PATCH] testsuite: Escape a loose '[' character inside a regexp.

Yao Qi qiyaoltc@gmail.com
Tue Jun 23 16:28:00 GMT 2015


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 (齐尧)



More information about the Gdb-patches mailing list