summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-11-18 14:28:30 -0700
committerKarl Williamson <khw@cpan.org>2019-11-18 14:39:42 -0700
commitf1d561b5fe9f8c282524ed30fe0e1e0caa549e88 (patch)
treeff070000b9c7126176b77cf63962da6c69064a47
parent3575137f59e2042b43b9baffcb2ec0dca1fd0255 (diff)
downloadperl-f1d561b5fe9f8c282524ed30fe0e1e0caa549e88.tar.gz
Clean up -Dy debugging
Commit 5d7580af4b14229eafb27db9b7a34b8b918876b4 didn't have it quite right.
-rw-r--r--doop.c10
-rw-r--r--op.c24
2 files changed, 21 insertions, 13 deletions
diff --git a/doop.c b/doop.c
index 1d761d5376..2c85c835f6 100644
--- a/doop.c
+++ b/doop.c
@@ -105,7 +105,7 @@ S_do_trans_simple(pTHX_ SV * const sv, const OPtrans_map * const tbl)
SvUTF8_on(sv);
SvSETMAGIC(sv);
}
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %" IVdf "\n",
+ DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %zu\n",
__FILE__, __LINE__, matches));
DEBUG_y(sv_dump(sv));
return matches;
@@ -159,7 +159,7 @@ S_do_trans_count(pTHX_ SV * const sv, const OPtrans_map * const tbl)
}
}
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: count returning %" IVdf "\n",
+ DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: count returning %zu\n",
__FILE__, __LINE__, matches));
return matches;
}
@@ -312,7 +312,7 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl)
SvUTF8_on(sv);
}
SvSETMAGIC(sv);
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %" IVdf "\n",
+ DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %zu\n",
__FILE__, __LINE__, matches));
DEBUG_y(sv_dump(sv));
return matches;
@@ -386,7 +386,7 @@ S_do_trans_count_invmap(pTHX_ SV * const sv, AV * const invmap)
s += s_len;
}
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %" IVdf "\n",
+ DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %zu\n",
__FILE__, __LINE__, matches));
return matches;
}
@@ -573,7 +573,7 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap)
}
SvSETMAGIC(sv);
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %" IVdf "\n",
+ DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: returning %zu\n",
__FILE__, __LINE__, matches));
DEBUG_y(sv_dump(sv));
return matches;
diff --git a/op.c b/op.c
index 643db1a3e8..66d773f1a1 100644
--- a/op.c
+++ b/op.c
@@ -6927,10 +6927,9 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
SV * inverted_tlist = _new_invlist(tlen);
Size_t temp_len;
- DEBUG_y(PerlIO_printf(Perl_debug_log, "%d: tstr=%s\n",
- __LINE__, _byte_dump_string(t, tend - t, 0)));
- DEBUG_y(PerlIO_printf(Perl_debug_log, "rstr=%s\n",
- _byte_dump_string(r, rend - r, 0)));
+ DEBUG_y(PerlIO_printf(Perl_debug_log,
+ "%s: %d: tstr before inversion=\n%s\n",
+ __FILE__, __LINE__, _byte_dump_string(t, tend - t, 0)));
while (t < tend) {
@@ -6968,7 +6967,6 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
/* The inversion list is done; now invert it */
_invlist_invert(inverted_tlist);
- DEBUG_y(sv_dump(inverted_tlist));
/* Now go through the inverted list and create a new tstr for the rest
* of the routine to use. Since the UTF-8 version can have ranges, and
@@ -7642,9 +7640,9 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
r_map[i+2] = TR_UNLISTED;
}
DEBUG_yv(PerlIO_printf(Perl_debug_log,
- "After iteration: span=%" IVdf ", t_range_count=%"
- IVdf ", r_range_count=%" IVdf "\n",
- span, t_range_count, r_range_count));
+ "After iteration: span=%" UVuf ", t_range_count=%"
+ UVuf " r_range_count=%" UVuf "\n",
+ span, t_range_count, r_range_count));
DEBUG_yv(invmap_dump(t_invlist, r_map));
} /* End of this chunk needs to be processed */
@@ -7856,6 +7854,16 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
}
+ DEBUG_y(PerlIO_printf(Perl_debug_log,
+ "/d=%d, /s=%d, /c=%d, identical=%d, grows=%d,"
+ " use_svop=%d, can_force_utf8=%d,\nexpansion=%g\n",
+ del, squash, complement,
+ cBOOL(o->op_private & OPpTRANS_IDENTICAL),
+ cBOOL(o->op_private & OPpTRANS_USE_SVOP),
+ cBOOL(o->op_private & OPpTRANS_GROWS),
+ cBOOL(o->op_private & OPpTRANS_CAN_FORCE_UTF8),
+ max_expansion));
+
Safefree(r_map);
if(del && rlen != 0 && r_count == t_count) {