This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] GDB testsuite: Escape paths used in regular expressions
- From: Pedro Alves <palves at redhat dot com>
- To: Zachary T Welch <zwelch at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Wed, 10 Feb 2016 16:46:31 +0000
- Subject: Re: [PATCH] GDB testsuite: Escape paths used in regular expressions
- Authentication-results: sourceware.org; auth=none
- References: <1455122399-31551-1-git-send-email-zwelch at codesourcery dot com>
On 02/10/2016 04:39 PM, Zachary T Welch wrote:
> This patch fixes problems with a few GDB testsuites when executing in a
> path that contains special characters (e.g. "++"). When such paths are
> used as a regular expression, the regular expression parser will choke
> and cause the tests to fail. This patch introduces a new function to
> escape strings that will be used as regular expressions, using it to
> sanitize path names used in expect scripts.
>
> If it looks good, please commit. Thanks!
>
> gdb/testsuite/:
> * gdb.base/maint.exp: Escape paths used in regular expressions.
> * gdb.stabs/weird.exp: Likewise.
> * gdb.exp (escape_regex_chars): New.
Seems like you reinvented string_to_regexp.
Thanks,
Pedro Alves