Skip to content

Commit 257ab4e

Browse files
committed
op_dump: display a PMOP's regex address/offset
When doing a low-level dump of a pattern-match op (PMOP), it currently displays a stringified representation of the regex attached to the op. This commit makes it also display the regex SV's address and, on threaded builds, the offset within the regex pad where that SV is stored.
1 parent c15c246 commit 257ab4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dump.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,13 @@ S_do_pmop_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const PMOP *pm)
979979

980980
kidbar = ((bar << 1) | cBOOL(pm->op_flags & OPf_KIDS)) << 1;
981981

982+
#ifdef USE_ITHREADS
983+
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file,
984+
"PMOFFSET = %" IVdf "\n", (IV)pm->op_pmoffset);
985+
#endif
986+
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file,
987+
"REGEX = 0x%" UVxf "\n", PTR2UV(PM_GETRE(pm)));
988+
982989
if (PM_GETRE(pm)) {
983990
char ch = (pm->op_pmflags & PMf_ONCE) ? '?' : '/';
984991
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file, "PMf_PRE %c%.*s%c\n",

0 commit comments

Comments
 (0)