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: [PING][PATCH] testsuite: Escape a loose '[' character inside a regexp.


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.


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