summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-09 12:56:03 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-09 19:28:34 -0700
commit01ffd0f1a566de2c2bb4912b1def7a86918cb79d (patch)
tree7cdd09281338cd1444a6460f6a694542077af928
parentcb2dcfb25ec8a3cf487a54f645efffed55b50153 (diff)
downloadperl-01ffd0f1a566de2c2bb4912b1def7a86918cb79d.tar.gz
dump.c: Dump contents of regexps’ mother_re field
This can make debugging easier if one needs to see the reference count of the parent regular expression.
-rw-r--r--dump.c3
-rw-r--r--ext/Devel-Peek/t/Peek.t60
2 files changed, 61 insertions, 2 deletions
diff --git a/dump.c b/dump.c
index 1d24f351cc..6c4ae04801 100644
--- a/dump.c
+++ b/dump.c
@@ -2187,6 +2187,9 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
PTR2UV(r->engine));
Perl_dump_indent(aTHX_ level, file, " MOTHER_RE = 0x%"UVxf"\n",
PTR2UV(r->mother_re));
+ if (nest < maxnest && r->mother_re)
+ do_sv_dump(level+1, file, (SV *)r->mother_re, nest+1,
+ maxnest, dumpops, pvlim);
Perl_dump_indent(aTHX_ level, file, " PAREN_NAMES = 0x%"UVxf"\n",
PTR2UV(r->paren_names));
Perl_dump_indent(aTHX_ level, file, " SUBSTRS = 0x%"UVxf"\n",
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index 76a5c7abea..32e6f1eaac 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -355,7 +355,35 @@ do_test('reference to regexp',
SUBCOFFSET = 0
SUBBEG = 0x0
ENGINE = $ADDR
- MOTHER_RE = $ADDR
+ MOTHER_RE = $ADDR'
+. ($] < 5.019003 ? '' : '
+ SV = REGEXP\($ADDR\) at $ADDR
+ REFCNT = 2
+ FLAGS = \(\)
+ PV = $ADDR "\(\?\^:tic\)"
+ CUR = 8
+ COMPFLAGS = 0x0 \(\)
+ EXTFLAGS = 0x680000 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
+ INTFLAGS = 0x0
+ NPARENS = 0
+ LASTPAREN = 0
+ LASTCLOSEPAREN = 0
+ MINLEN = 3
+ MINLENRET = 3
+ GOFS = 0
+ PRE_PREFIX = 4
+ SUBLEN = 0
+ SUBOFFSET = 0
+ SUBCOFFSET = 0
+ SUBBEG = 0x0
+ ENGINE = $ADDR
+ MOTHER_RE = 0x0
+ PAREN_NAMES = 0x0
+ SUBSTRS = $ADDR
+ PPRIVATE = $ADDR
+ OFFS = $ADDR
+ QR_ANONCV = 0x0(?:
+ SAVED_COPY = 0x0)?') . '
PAREN_NAMES = 0x0
SUBSTRS = $ADDR
PPRIVATE = $ADDR
@@ -1074,7 +1102,35 @@ do_test('UTF-8 in a regular expression',
SUBCOFFSET = 0
SUBBEG = 0x0
ENGINE = $ADDR
- MOTHER_RE = $ADDR
+ MOTHER_RE = $ADDR'
+. ($] < 5.019003 ? '' : '
+ SV = REGEXP\($ADDR\) at $ADDR
+ REFCNT = 2
+ FLAGS = \(UTF8\)
+ PV = $ADDR "\(\?\^u:\\\\\\\\x\{100\}\)" \[UTF8 "\(\?\^u:\\\\\\\\x\{100\}\)"\]
+ CUR = 13
+ COMPFLAGS = 0x0 \(\)
+ EXTFLAGS = 0x680040 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
+ INTFLAGS = 0x0
+ NPARENS = 0
+ LASTPAREN = 0
+ LASTCLOSEPAREN = 0
+ MINLEN = 1
+ MINLENRET = 1
+ GOFS = 0
+ PRE_PREFIX = 5
+ SUBLEN = 0
+ SUBOFFSET = 0
+ SUBCOFFSET = 0
+ SUBBEG = 0x0
+ ENGINE = $ADDR
+ MOTHER_RE = 0x0
+ PAREN_NAMES = 0x0
+ SUBSTRS = $ADDR
+ PPRIVATE = $ADDR
+ OFFS = $ADDR
+ QR_ANONCV = 0x0(?:
+ SAVED_COPY = 0x0)?') . '
PAREN_NAMES = 0x0
SUBSTRS = $ADDR
PPRIVATE = $ADDR