summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-02-24 12:16:46 -0700
committerKarl Williamson <khw@cpan.org>2020-03-05 14:22:44 -0700
commit51bd194113cefdf4e463657fc6a3685fb469e9da (patch)
tree6be0aaa0a0a11b11aaa905df092c16593875b9c3 /regcomp.h
parented76e9fc1a9ddac2b3ef3ee191f5350085d0f398 (diff)
downloadperl-51bd194113cefdf4e463657fc6a3685fb469e9da.tar.gz
Allow wildcard pattern debugging
This fixes #17026 Patterns can have subpatterns since 5.30. These are processed when encountered, by suspending the main pattern compilation, compiling the subpattern, and then matching that against the set of all legal possibilities, which Perl knows about. Debugging info for the compilation portion of the subpattern was added by be8790133a0ce8fc67454e55e7849a47a0858d32, without fanfare. But, prior to this new commit, debugging info was not available for that matching portion of the compilation, except under DEBUGGING builds, with -Drv. This commit adds a new option to 'use re qw(Debug ...)', WILDCARD, to enable subpattern match debugging. Whatever other match debugging options have been turned on will show up when a wildcard subpattern is compiled iff WILDCARD is specified. The output of this may be voluminous, which is why you have to ask for it specifically. Or, the EXTRA option turns it on, along with several other things.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/regcomp.h b/regcomp.h
index c818ba8377..33dec76252 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -1029,7 +1029,7 @@ re.pm, especially to the documentation.
#define RE_DEBUG_EXECUTE_TRIE 0x000400
/* Extra */
-#define RE_DEBUG_EXTRA_MASK 0x1FF0000
+#define RE_DEBUG_EXTRA_MASK 0x3FF0000
#define RE_DEBUG_EXTRA_TRIE 0x0010000
#define RE_DEBUG_EXTRA_OFFSETS 0x0020000
#define RE_DEBUG_EXTRA_OFFDEBUG 0x0040000
@@ -1038,6 +1038,7 @@ re.pm, especially to the documentation.
#define RE_DEBUG_EXTRA_BUFFERS 0x0400000
#define RE_DEBUG_EXTRA_GPOS 0x0800000
#define RE_DEBUG_EXTRA_DUMP_PRE_OPTIMIZE 0x1000000
+#define RE_DEBUG_EXTRA_WILDCARD 0x2000000
/* combined */
#define RE_DEBUG_EXTRA_STACK 0x0280000
@@ -1116,6 +1117,8 @@ re.pm, especially to the documentation.
#define DECLARE_AND_GET_RE_DEBUG_FLAGS volatile IV re_debug_flags = 0; \
PERL_UNUSED_VAR(re_debug_flags); GET_RE_DEBUG_FLAGS;
+#define isDEBUG_WILDCARD (DEBUG_v_TEST || RE_DEBUG_FLAG(RE_DEBUG_EXTRA_WILDCARD))
+
#define RE_PV_COLOR_DECL(rpv,rlen,isuni,dsv,pv,l,m,c1,c2) \
const char * const rpv = \
pv_pretty((dsv), (pv), (l), (m), \
@@ -1149,6 +1152,7 @@ re.pm, especially to the documentation.
#define RE_PV_QUOTED_DECL(rpv,isuni,dsv,pv,l,m)
#define RE_SV_DUMPLEN(ItEm)
#define RE_SV_TAIL(ItEm)
+#define isDEBUG_WILDCARD 0
#endif /* DEBUG RELATED DEFINES */