diff options
author | Karl Williamson <khw@cpan.org> | 2019-11-18 14:28:30 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-11-18 14:39:42 -0700 |
commit | f1d561b5fe9f8c282524ed30fe0e1e0caa549e88 (patch) | |
tree | ff070000b9c7126176b77cf63962da6c69064a47 | |
parent | 3575137f59e2042b43b9baffcb2ec0dca1fd0255 (diff) | |
download | perl-f1d561b5fe9f8c282524ed30fe0e1e0caa549e88.tar.gz |
Clean up -Dy debugging
Commit 5d7580af4b14229eafb27db9b7a34b8b918876b4 didn't have it quite
right.
-rw-r--r-- | doop.c | 10 | ||||
-rw-r--r-- | op.c | 24 |
2 files changed, 21 insertions, 13 deletions
@@ -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; @@ -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) { |