     1			/*    dump.c
     2			 *
     3			 *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4			 *    2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
     5			 *
     6			 *    You may distribute under the terms of either the GNU General Public
     7			 *    License or the Artistic License, as specified in the README file.
     8			 *
     9			 */
    10			
    11			/*
    12			 * "'You have talked long in your sleep, Frodo,' said Gandalf gently, 'and
    13			 * it has not been hard for me to read your mind and memory.'"
    14			 */
    15			
    16			/* This file contains utility routines to dump the contents of SV and OP
    17			 * structures, as used by command-line options like -Dt and -Dx, and
    18			 * by Devel::Peek.
    19			 *
    20			 * It also holds the debugging version of the  runops function.
    21			 */
    22			
    23			#include "EXTERN.h"
    24			#define PERL_IN_DUMP_C
    25			#include "perl.h"
    26			#include "regcomp.h"
    27			
    28			#define Sequence PL_op_sequence
    29			
    30			void
    31			Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...)
    32	         199    {
    33	         199        va_list args;
    34	         199        va_start(args, pat);
    35	         199        dump_vindent(level, file, pat, &args);
    36			    va_end(args);
    37			}
    38			
    39			void
    40			Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args)
    41	         199    {
    42	         199        PerlIO_printf(file, "%*s", (int)(level*PL_dumpindent), "");
    43	         199        PerlIO_vprintf(file, pat, *args);
    44			}
    45			
    46			void
    47			Perl_dump_all(pTHX)
    48	      ######    {
    49	      ######        PerlIO_setlinebuf(Perl_debug_log);
    50	      ######        if (PL_main_root)
    51	      ######    	op_dump(PL_main_root);
    52	      ######        dump_packsubs(PL_defstash);
    53			}
    54			
    55			void
    56			Perl_dump_packsubs(pTHX_ const HV *stash)
    57	      ######    {
    58	      ######        I32	i;
    59			
    60	      ######        if (!HvARRAY(stash))
    61	      ######    	return;
    62	      ######        for (i = 0; i <= (I32) HvMAX(stash); i++) {
    63	      ######            const HE *entry;
    64	      ######    	for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
    65	      ######                const GV *gv = (GV*)HeVAL(entry);
    66	      ######                const HV *hv;
    67	      ######    	    if (SvTYPE(gv) != SVt_PVGV || !GvGP(gv))
    68	      ######    		continue;
    69	      ######    	    if (GvCVu(gv))
    70	      ######    		dump_sub(gv);
    71	      ######    	    if (GvFORM(gv))
    72	      ######    		dump_form(gv);
    73	      ######    	    if (HeKEY(entry)[HeKLEN(entry)-1] == ':'
    74					&& (hv = GvHV(gv)) && hv != PL_defstash)
    75	      ######    		dump_packsubs(hv);		/* nested package */
    76				}
    77			    }
    78			}
    79			
    80			void
    81			Perl_dump_sub(pTHX_ const GV *gv)
    82	      ######    {
    83	      ######        SV * const sv = sv_newmortal();
    84			
    85	      ######        gv_fullname3(sv, gv, Nullch);
    86	      ######        Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX_const(sv));
    87	      ######        if (CvXSUB(GvCV(gv)))
    88	      ######    	Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%"UVxf" %d)\n",
    89				    PTR2UV(CvXSUB(GvCV(gv))),
    90				    (int)CvXSUBANY(GvCV(gv)).any_i32);
    91	      ######        else if (CvROOT(GvCV(gv)))
    92	      ######    	op_dump(CvROOT(GvCV(gv)));
    93			    else
    94	      ######    	Perl_dump_indent(aTHX_ 0, Perl_debug_log, "<undef>\n");
    95			}
    96			
    97			void
    98			Perl_dump_form(pTHX_ const GV *gv)
    99	      ######    {
   100	      ######        SV * const sv = sv_newmortal();
   101			
   102	      ######        gv_fullname3(sv, gv, Nullch);
   103	      ######        Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nFORMAT %s = ", SvPVX_const(sv));
   104	      ######        if (CvROOT(GvFORM(gv)))
   105	      ######    	op_dump(CvROOT(GvFORM(gv)));
   106			    else
   107	      ######    	Perl_dump_indent(aTHX_ 0, Perl_debug_log, "<undef>\n");
   108			}
   109			
   110			void
   111			Perl_dump_eval(pTHX)
   112	      ######    {
   113	      ######        op_dump(PL_eval_root);
   114			}
   115			
   116			char *
   117			Perl_pv_display(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
   118	         131    {
   119	         131        const bool nul_terminated = len > cur && pv[cur] == '\0';
   120	         131        bool truncated = 0;
   121			
   122	         131        sv_setpvn(dsv, "\"", 1);
   123	         571        for (; cur--; pv++) {
   124	         221    	if (pvlim && SvCUR(dsv) >= pvlim) {
   125	           1                truncated = 1;
   126	           1    	    break;
   127			        }
   128	         220    	switch (*pv) {
   129	           1    	case '\t': sv_catpvn(dsv, "\\t", 2);  break;
   130	           1    	case '\n': sv_catpvn(dsv, "\\n", 2);  break;
   131	           1    	case '\r': sv_catpvn(dsv, "\\r", 2);  break;
   132	           1    	case '\f': sv_catpvn(dsv, "\\f", 2);  break;
   133	           1    	case '"':  sv_catpvn(dsv, "\\\"", 2); break;
   134	           1    	case '\\': sv_catpvn(dsv, "\\\\", 2); break;
   135				default:
   136	         214    	    if (isPRINT(*pv))
   137	         203    		sv_catpvn(dsv, pv, 1);
   138	          11    	    else if (cur && isDIGIT(*(pv+1)))
   139	           1    		Perl_sv_catpvf(aTHX_ dsv, "\\%03o", (U8)*pv);
   140				    else
   141	          10    		Perl_sv_catpvf(aTHX_ dsv, "\\%o", (U8)*pv);
   142			        }
   143			    }
   144	         131        sv_catpvn(dsv, "\"", 1);
   145	         131        if (truncated)
   146	           1    	sv_catpvn(dsv, "...", 3);
   147	         131        if (nul_terminated)
   148	           8    	sv_catpvn(dsv, "\\0", 2);
   149			
   150	         131        return SvPVX(dsv);
   151			}
   152			
   153			char *
   154			Perl_sv_peek(pTHX_ SV *sv)
   155	           1    {
   156			    dVAR;
   157	           1        SV *t = sv_newmortal();
   158	           1        int unref = 0;
   159			
   160	           1        sv_setpvn(t, "", 0);
   161			  retry:
   162	           1        if (!sv) {
   163	      ######    	sv_catpv(t, "VOID");
   164	      ######    	goto finish;
   165			    }
   166	           1        else if (sv == (SV*)0x55555555 || SvTYPE(sv) == 'U') {
   167	      ######    	sv_catpv(t, "WILD");
   168	      ######    	goto finish;
   169			    }
   170	           1        else if (sv == &PL_sv_undef || sv == &PL_sv_no || sv == &PL_sv_yes || sv == &PL_sv_placeholder) {
   171	      ######    	if (sv == &PL_sv_undef) {
   172	      ######    	    sv_catpv(t, "SV_UNDEF");
   173	      ######    	    if (!(SvFLAGS(sv) & (SVf_OK|SVf_OOK|SVs_OBJECT|
   174							 SVs_GMG|SVs_SMG|SVs_RMG)) &&
   175					SvREADONLY(sv))
   176	      ######    		goto finish;
   177				}
   178	      ######    	else if (sv == &PL_sv_no) {
   179	      ######    	    sv_catpv(t, "SV_NO");
   180	      ######    	    if (!(SvFLAGS(sv) & (SVf_ROK|SVf_OOK|SVs_OBJECT|
   181							 SVs_GMG|SVs_SMG|SVs_RMG)) &&
   182					!(~SvFLAGS(sv) & (SVf_POK|SVf_NOK|SVf_READONLY|
   183							  SVp_POK|SVp_NOK)) &&
   184					SvCUR(sv) == 0 &&
   185					SvNVX(sv) == 0.0)
   186	      ######    		goto finish;
   187				}
   188	      ######    	else if (sv == &PL_sv_yes) {
   189	      ######    	    sv_catpv(t, "SV_YES");
   190	      ######    	    if (!(SvFLAGS(sv) & (SVf_ROK|SVf_OOK|SVs_OBJECT|
   191							 SVs_GMG|SVs_SMG|SVs_RMG)) &&
   192					!(~SvFLAGS(sv) & (SVf_POK|SVf_NOK|SVf_READONLY|
   193							  SVp_POK|SVp_NOK)) &&
   194					SvCUR(sv) == 1 &&
   195					SvPVX_const(sv) && *SvPVX_const(sv) == '1' &&
   196					SvNVX(sv) == 1.0)
   197	      ######    		goto finish;
   198				}
   199				else {
   200	      ######    	    sv_catpv(t, "SV_PLACEHOLDER");
   201	      ######    	    if (!(SvFLAGS(sv) & (SVf_OK|SVf_OOK|SVs_OBJECT|
   202							 SVs_GMG|SVs_SMG|SVs_RMG)) &&
   203					SvREADONLY(sv))
   204	      ######    		goto finish;
   205				}
   206	      ######    	sv_catpv(t, ":");
   207			    }
   208	           1        else if (SvREFCNT(sv) == 0) {
   209	      ######    	sv_catpv(t, "(");
   210	      ######    	unref++;
   211			    }
   212	           1        else if (DEBUG_R_TEST_) {
   213	      ######    	int is_tmp = 0;
   214	      ######    	I32 ix;
   215				/* is this SV on the tmps stack? */
   216	      ######    	for (ix=PL_tmps_ix; ix>=0; ix--) {
   217	      ######    	    if (PL_tmps_stack[ix] == sv) {
   218	      ######    		is_tmp = 1;
   219	      ######    		break;
   220				    }
   221				}
   222	      ######    	if (SvREFCNT(sv) > 1)
   223	      ######    	    Perl_sv_catpvf(aTHX_ t, "<%"UVuf"%s>", (UV)SvREFCNT(sv),
   224					    is_tmp ? "T" : "");
   225	      ######    	else if (is_tmp)
   226	      ######    	    sv_catpv(t, "<T>");
   227			    }
   228			
   229	           1        if (SvROK(sv)) {
   230	      ######    	sv_catpv(t, "\\");
   231	      ######    	if (SvCUR(t) + unref > 10) {
   232	      ######    	    SvCUR_set(t, unref + 3);
   233	      ######    	    *SvEND(t) = '\0';
   234	      ######    	    sv_catpv(t, "...");
   235	      ######    	    goto finish;
   236				}
   237	      ######    	sv = (SV*)SvRV(sv);
   238	      ######    	goto retry;
   239			    }
   240	           1        switch (SvTYPE(sv)) {
   241			    default:
   242	      ######    	sv_catpv(t, "FREED");
   243	      ######    	goto finish;
   244			
   245			    case SVt_NULL:
   246	      ######    	sv_catpv(t, "UNDEF");
   247	      ######    	goto finish;
   248			    case SVt_IV:
   249	           1    	sv_catpv(t, "IV");
   250	           1    	break;
   251			    case SVt_NV:
   252	      ######    	sv_catpv(t, "NV");
   253	      ######    	break;
   254			    case SVt_RV:
   255	      ######    	sv_catpv(t, "RV");
   256	      ######    	break;
   257			    case SVt_PV:
   258	      ######    	sv_catpv(t, "PV");
   259	      ######    	break;
   260			    case SVt_PVIV:
   261	      ######    	sv_catpv(t, "PVIV");
   262	      ######    	break;
   263			    case SVt_PVNV:
   264	      ######    	sv_catpv(t, "PVNV");
   265	      ######    	break;
   266			    case SVt_PVMG:
   267	      ######    	sv_catpv(t, "PVMG");
   268	      ######    	break;
   269			    case SVt_PVLV:
   270	      ######    	sv_catpv(t, "PVLV");
   271	      ######    	break;
   272			    case SVt_PVAV:
   273	      ######    	sv_catpv(t, "AV");
   274	      ######    	break;
   275			    case SVt_PVHV:
   276	      ######    	sv_catpv(t, "HV");
   277	      ######    	break;
   278			    case SVt_PVCV:
   279	      ######    	if (CvGV(sv))
   280	      ######    	    Perl_sv_catpvf(aTHX_ t, "CV(%s)", GvNAME(CvGV(sv)));
   281				else
   282	      ######    	    sv_catpv(t, "CV()");
   283	      ######    	goto finish;
   284			    case SVt_PVGV:
   285	      ######    	sv_catpv(t, "GV");
   286	      ######    	break;
   287			    case SVt_PVBM:
   288	      ######    	sv_catpv(t, "BM");
   289	      ######    	break;
   290			    case SVt_PVFM:
   291	      ######    	sv_catpv(t, "FM");
   292	      ######    	break;
   293			    case SVt_PVIO:
   294	      ######    	sv_catpv(t, "IO");
   295	           1    	break;
   296			    }
   297			
   298	           1        if (SvPOKp(sv)) {
   299	      ######    	if (!SvPVX_const(sv))
   300	      ######    	    sv_catpv(t, "(null)");
   301				else {
   302	      ######    	    SV *tmp = newSVpvn("", 0);
   303	      ######    	    sv_catpv(t, "(");
   304	      ######    	    if (SvOOK(sv))
   305	      ######    		Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX_const(sv)-SvIVX(sv), SvIVX(sv), 0, 127));
   306	      ######    	    Perl_sv_catpvf(aTHX_ t, "%s)", pv_display(tmp, SvPVX_const(sv), SvCUR(sv), SvLEN(sv), 127));
   307	      ######    	    if (SvUTF8(sv))
   308	      ######    		Perl_sv_catpvf(aTHX_ t, " [UTF8 \"%s\"]",
   309						       sv_uni_display(tmp, sv, 8 * sv_len_utf8(sv),
   310								      UNI_DISPLAY_QQ));
   311	      ######    	    SvREFCNT_dec(tmp);
   312				}
   313			    }
   314	           1        else if (SvNOKp(sv)) {
   315	      ######    	STORE_NUMERIC_LOCAL_SET_STANDARD();
   316	      ######    	Perl_sv_catpvf(aTHX_ t, "(%"NVgf")",SvNVX(sv));
   317	      ######    	RESTORE_NUMERIC_LOCAL();
   318			    }
   319	           1        else if (SvIOKp(sv)) {
   320	           1    	if (SvIsUV(sv))
   321	      ######    	    Perl_sv_catpvf(aTHX_ t, "(%"UVuf")", (UV)SvUVX(sv));
   322				else
   323	           1                Perl_sv_catpvf(aTHX_ t, "(%"IVdf")", (IV)SvIVX(sv));
   324			    }
   325			    else
   326	      ######    	sv_catpv(t, "()");
   327			
   328			  finish:
   329	           1        if (unref) {
   330	      ######    	while (unref--)
   331	      ######    	    sv_catpv(t, ")");
   332			    }
   333	           1        return SvPV_nolen(t);
   334			}
   335			
   336			void
   337			Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
   338	      ######    {
   339	      ######        char ch;
   340			
   341	      ######        if (!pm) {
   342	      ######    	Perl_dump_indent(aTHX_ level, file, "{}\n");
   343	      ######    	return;
   344			    }
   345	      ######        Perl_dump_indent(aTHX_ level, file, "{\n");
   346	      ######        level++;
   347	      ######        if (pm->op_pmflags & PMf_ONCE)
   348	      ######    	ch = '?';
   349			    else
   350	      ######    	ch = '/';
   351	      ######        if (PM_GETRE(pm))
   352	      ######    	Perl_dump_indent(aTHX_ level, file, "PMf_PRE %c%s%c%s\n",
   353				     ch, PM_GETRE(pm)->precomp, ch,
   354				     (pm->op_private & OPpRUNTIME) ? " (RUNTIME)" : "");
   355			    else
   356	      ######    	Perl_dump_indent(aTHX_ level, file, "PMf_PRE (RUNTIME)\n");
   357	      ######        if (pm->op_type != OP_PUSHRE && pm->op_pmreplroot) {
   358	      ######    	Perl_dump_indent(aTHX_ level, file, "PMf_REPL = ");
   359	      ######    	op_dump(pm->op_pmreplroot);
   360			    }
   361	      ######        if (pm->op_pmflags || (PM_GETRE(pm) && PM_GETRE(pm)->check_substr)) {
   362	      ######    	SV *tmpsv = newSVpvn("", 0);
   363	      ######    	if (pm->op_pmdynflags & PMdf_USED)
   364	      ######    	    sv_catpv(tmpsv, ",USED");
   365	      ######    	if (pm->op_pmdynflags & PMdf_TAINTED)
   366	      ######    	    sv_catpv(tmpsv, ",TAINTED");
   367	      ######    	if (pm->op_pmflags & PMf_ONCE)
   368	      ######    	    sv_catpv(tmpsv, ",ONCE");
   369	      ######    	if (PM_GETRE(pm) && PM_GETRE(pm)->check_substr
   370				    && !(PM_GETRE(pm)->reganch & ROPT_NOSCAN))
   371	      ######    	    sv_catpv(tmpsv, ",SCANFIRST");
   372	      ######    	if (PM_GETRE(pm) && PM_GETRE(pm)->check_substr
   373				    && PM_GETRE(pm)->reganch & ROPT_CHECK_ALL)
   374	      ######    	    sv_catpv(tmpsv, ",ALL");
   375	      ######    	if (pm->op_pmflags & PMf_SKIPWHITE)
   376	      ######    	    sv_catpv(tmpsv, ",SKIPWHITE");
   377	      ######    	if (pm->op_pmflags & PMf_CONST)
   378	      ######    	    sv_catpv(tmpsv, ",CONST");
   379	      ######    	if (pm->op_pmflags & PMf_KEEP)
   380	      ######    	    sv_catpv(tmpsv, ",KEEP");
   381	      ######    	if (pm->op_pmflags & PMf_GLOBAL)
   382	      ######    	    sv_catpv(tmpsv, ",GLOBAL");
   383	      ######    	if (pm->op_pmflags & PMf_CONTINUE)
   384	      ######    	    sv_catpv(tmpsv, ",CONTINUE");
   385	      ######    	if (pm->op_pmflags & PMf_RETAINT)
   386	      ######    	    sv_catpv(tmpsv, ",RETAINT");
   387	      ######    	if (pm->op_pmflags & PMf_EVAL)
   388	      ######    	    sv_catpv(tmpsv, ",EVAL");
   389	      ######    	Perl_dump_indent(aTHX_ level, file, "PMFLAGS = (%s)\n", SvCUR(tmpsv) ? SvPVX_const(tmpsv) + 1 : "");
   390	      ######    	SvREFCNT_dec(tmpsv);
   391			    }
   392			
   393	      ######        Perl_dump_indent(aTHX_ level-1, file, "}\n");
   394			}
   395			
   396			void
   397			Perl_pmop_dump(pTHX_ PMOP *pm)
   398	      ######    {
   399	      ######        do_pmop_dump(0, Perl_debug_log, pm);
   400			}
   401			
   402			/* An op sequencer.  We visit the ops in the order they're to execute. */
   403			
   404			STATIC void
   405			sequence(pTHX_ register const OP *o)
   406	      ######    {
   407			    dVAR;
   408	      ######        SV      *op;
   409	      ######        const char *key;
   410	      ######        STRLEN   len;
   411	      ######        const OP *oldop = 0;
   412	      ######        OP      *l;
   413			
   414	      ######        if (!o)
   415	      ######    	return;
   416			
   417	      ######        op = newSVuv(PTR2UV(o));
   418	      ######        key = SvPV_const(op, len);
   419	      ######        if (hv_exists(Sequence, key, len))
   420	      ######    	return;
   421			
   422	      ######        for (; o; o = o->op_next) {
   423	      ######    	op = newSVuv(PTR2UV(o));
   424	      ######    	key = SvPV_const(op, len);
   425	      ######    	if (hv_exists(Sequence, key, len))
   426	      ######    	    break;
   427			
   428	      ######    	switch (o->op_type) {
   429				case OP_STUB:
   430	      ######    	    if ((o->op_flags & OPf_WANT) != OPf_WANT_LIST) {
   431	      ######    		hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   432	      ######    		break;
   433				    }
   434	      ######    	    goto nothin;
   435				case OP_NULL:
   436	      ######    	    if (oldop && o->op_next)
   437	      ######    		continue;
   438	      ######    	    break;
   439				case OP_SCALAR:
   440				case OP_LINESEQ:
   441				case OP_SCOPE:
   442				  nothin:
   443	      ######    	    if (oldop && o->op_next)
   444	      ######    		continue;
   445	      ######    	    hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   446	      ######    	    break;
   447			
   448				case OP_MAPWHILE:
   449				case OP_GREPWHILE:
   450				case OP_AND:
   451				case OP_OR:
   452				case OP_DOR:
   453				case OP_ANDASSIGN:
   454				case OP_ORASSIGN:
   455				case OP_DORASSIGN:
   456				case OP_COND_EXPR:
   457				case OP_RANGE:
   458	      ######    	    hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   459	      ######    	    for (l = cLOGOPo->op_other; l && l->op_type == OP_NULL; l = l->op_next)
   460					;
   461	      ######    	    sequence(aTHX_ l);
   462	      ######    	    break;
   463			
   464				case OP_ENTERLOOP:
   465				case OP_ENTERITER:
   466	      ######    	    hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   467	      ######    	    for (l = cLOOPo->op_redoop; l && l->op_type == OP_NULL; l = l->op_next)
   468					;
   469	      ######    	    sequence(aTHX_ l);
   470	      ######    	    for (l = cLOOPo->op_nextop; l && l->op_type == OP_NULL; l = l->op_next)
   471					;
   472	      ######    	    sequence(aTHX_ l);
   473	      ######    	    for (l = cLOOPo->op_lastop; l && l->op_type == OP_NULL; l = l->op_next)
   474					;
   475	      ######    	    sequence(aTHX_ l);
   476	      ######    	    break;
   477			
   478				case OP_QR:
   479				case OP_MATCH:
   480				case OP_SUBST:
   481	      ######    	    hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   482	      ######    	    for (l = cPMOPo->op_pmreplstart; l && l->op_type == OP_NULL; l = l->op_next)
   483					;
   484	      ######    	    sequence(aTHX_ l);
   485	      ######    	    break;
   486			
   487				case OP_HELEM:
   488	      ######    	    break;
   489			
   490				default:
   491	      ######    	    hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
   492	      ######    	    break;
   493				}
   494	      ######    	oldop = o;
   495			    }
   496			}
   497			
   498			STATIC UV
   499			sequence_num(pTHX_ const OP *o)
   500	           2    {
   501			    dVAR;
   502	           2        SV     *op,
   503	           2              **seq;
   504	           2        const char *key;
   505	           2        STRLEN  len;
   506	           2        if (!o) return 0;
   507	           2        op = newSVuv(PTR2UV(o));
   508	           2        key = SvPV_const(op, len);
   509	           2        seq = hv_fetch(Sequence, key, len, 0);
   510	           2        return seq ? SvUV(*seq): 0;
   511			}
   512			
   513			void
   514			Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
   515	      ######    {
   516			    dVAR;
   517	      ######        UV      seq;
   518	      ######        sequence(aTHX_ o);
   519	      ######        Perl_dump_indent(aTHX_ level, file, "{\n");
   520	      ######        level++;
   521	      ######        seq = sequence_num(aTHX_ o);
   522	      ######        if (seq)
   523	      ######    	PerlIO_printf(file, "%-4"UVf, seq);
   524			    else
   525	      ######    	PerlIO_printf(file, "    ");
   526	      ######        PerlIO_printf(file,
   527					  "%*sTYPE = %s  ===> ",
   528					  (int)(PL_dumpindent*level-4), "", OP_NAME(o));
   529	      ######        if (o->op_next)
   530	      ######    	PerlIO_printf(file, seq ? "%"UVf"\n" : "(%"UVf")\n",
   531							sequence_num(aTHX_ o->op_next));
   532			    else
   533	      ######    	PerlIO_printf(file, "DONE\n");
   534	      ######        if (o->op_targ) {
   535	      ######    	if (o->op_type == OP_NULL)
   536				{
   537	      ######    	    Perl_dump_indent(aTHX_ level, file, "  (was %s)\n", PL_op_name[o->op_targ]);
   538	      ######    	    if (o->op_targ == OP_NEXTSTATE)
   539				    {
   540	      ######    		if (CopLINE(cCOPo))
   541	      ######    		    Perl_dump_indent(aTHX_ level, file, "LINE = %"UVf"\n",
   542							     (UV)CopLINE(cCOPo));
   543	      ######    		if (CopSTASHPV(cCOPo))
   544	      ######    		    Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
   545							     CopSTASHPV(cCOPo));
   546	      ######    		if (cCOPo->cop_label)
   547	      ######    		    Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",
   548							     cCOPo->cop_label);
   549				    }
   550				}
   551				else
   552	      ######    	    Perl_dump_indent(aTHX_ level, file, "TARG = %ld\n", (long)o->op_targ);
   553			    }
   554			#ifdef DUMPADDR
   555			    Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next);
   556			#endif
   557	      ######        if (o->op_flags) {
   558	      ######    	SV *tmpsv = newSVpvn("", 0);
   559	      ######    	switch (o->op_flags & OPf_WANT) {
   560				case OPf_WANT_VOID:
   561	      ######    	    sv_catpv(tmpsv, ",VOID");
   562	      ######    	    break;
   563				case OPf_WANT_SCALAR:
   564	      ######    	    sv_catpv(tmpsv, ",SCALAR");
   565	      ######    	    break;
   566				case OPf_WANT_LIST:
   567	      ######    	    sv_catpv(tmpsv, ",LIST");
   568	      ######    	    break;
   569				default:
   570	      ######    	    sv_catpv(tmpsv, ",UNKNOWN");
   571	      ######    	    break;
   572				}
   573	      ######    	if (o->op_flags & OPf_KIDS)
   574	      ######    	    sv_catpv(tmpsv, ",KIDS");
   575	      ######    	if (o->op_flags & OPf_PARENS)
   576	      ######    	    sv_catpv(tmpsv, ",PARENS");
   577	      ######    	if (o->op_flags & OPf_STACKED)
   578	      ######    	    sv_catpv(tmpsv, ",STACKED");
   579	      ######    	if (o->op_flags & OPf_REF)
   580	      ######    	    sv_catpv(tmpsv, ",REF");
   581	      ######    	if (o->op_flags & OPf_MOD)
   582	      ######    	    sv_catpv(tmpsv, ",MOD");
   583	      ######    	if (o->op_flags & OPf_SPECIAL)
   584	      ######    	    sv_catpv(tmpsv, ",SPECIAL");
   585	      ######    	Perl_dump_indent(aTHX_ level, file, "FLAGS = (%s)\n", SvCUR(tmpsv) ? SvPVX_const(tmpsv) + 1 : "");
   586	      ######    	SvREFCNT_dec(tmpsv);
   587			    }
   588	      ######        if (o->op_private) {
   589	      ######    	SV *tmpsv = newSVpvn("", 0);
   590	      ######    	if (PL_opargs[o->op_type] & OA_TARGLEX) {
   591	      ######    	    if (o->op_private & OPpTARGET_MY)
   592	      ######    		sv_catpv(tmpsv, ",TARGET_MY");
   593				}
   594	      ######    	else if (o->op_type == OP_LEAVESUB ||
   595					 o->op_type == OP_LEAVE ||
   596					 o->op_type == OP_LEAVESUBLV ||
   597					 o->op_type == OP_LEAVEWRITE) {
   598	      ######    	    if (o->op_private & OPpREFCOUNTED)
   599	      ######    		sv_catpv(tmpsv, ",REFCOUNTED");
   600				}
   601	      ######            else if (o->op_type == OP_AASSIGN) {
   602	      ######    	    if (o->op_private & OPpASSIGN_COMMON)
   603	      ######    		sv_catpv(tmpsv, ",COMMON");
   604				}
   605	      ######    	else if (o->op_type == OP_SASSIGN) {
   606	      ######    	    if (o->op_private & OPpASSIGN_BACKWARDS)
   607	      ######    		sv_catpv(tmpsv, ",BACKWARDS");
   608				}
   609	      ######    	else if (o->op_type == OP_TRANS) {
   610	      ######    	    if (o->op_private & OPpTRANS_SQUASH)
   611	      ######    		sv_catpv(tmpsv, ",SQUASH");
   612	      ######    	    if (o->op_private & OPpTRANS_DELETE)
   613	      ######    		sv_catpv(tmpsv, ",DELETE");
   614	      ######    	    if (o->op_private & OPpTRANS_COMPLEMENT)
   615	      ######    		sv_catpv(tmpsv, ",COMPLEMENT");
   616	      ######    	    if (o->op_private & OPpTRANS_IDENTICAL)
   617	      ######    		sv_catpv(tmpsv, ",IDENTICAL");
   618	      ######    	    if (o->op_private & OPpTRANS_GROWS)
   619	      ######    		sv_catpv(tmpsv, ",GROWS");
   620				}
   621	      ######    	else if (o->op_type == OP_REPEAT) {
   622	      ######    	    if (o->op_private & OPpREPEAT_DOLIST)
   623	      ######    		sv_catpv(tmpsv, ",DOLIST");
   624				}
   625	      ######    	else if (o->op_type == OP_ENTERSUB ||
   626					 o->op_type == OP_RV2SV ||
   627					 o->op_type == OP_GVSV ||
   628					 o->op_type == OP_RV2AV ||
   629					 o->op_type == OP_RV2HV ||
   630					 o->op_type == OP_RV2GV ||
   631					 o->op_type == OP_AELEM ||
   632					 o->op_type == OP_HELEM )
   633				{
   634	      ######    	    if (o->op_type == OP_ENTERSUB) {
   635	      ######    		if (o->op_private & OPpENTERSUB_AMPER)
   636	      ######    		    sv_catpv(tmpsv, ",AMPER");
   637	      ######    		if (o->op_private & OPpENTERSUB_DB)
   638	      ######    		    sv_catpv(tmpsv, ",DB");
   639	      ######    		if (o->op_private & OPpENTERSUB_HASTARG)
   640	      ######    		    sv_catpv(tmpsv, ",HASTARG");
   641	      ######    		if (o->op_private & OPpENTERSUB_NOPAREN)
   642	      ######    		    sv_catpv(tmpsv, ",NOPAREN");
   643	      ######    		if (o->op_private & OPpENTERSUB_INARGS)
   644	      ######    		    sv_catpv(tmpsv, ",INARGS");
   645	      ######    		if (o->op_private & OPpENTERSUB_NOMOD)
   646	      ######    		    sv_catpv(tmpsv, ",NOMOD");
   647				    }
   648				    else {
   649	      ######    		switch (o->op_private & OPpDEREF) {
   650				    case OPpDEREF_SV:
   651	      ######    		sv_catpv(tmpsv, ",SV");
   652	      ######    		break;
   653				    case OPpDEREF_AV:
   654	      ######    		sv_catpv(tmpsv, ",AV");
   655	      ######    		break;
   656				    case OPpDEREF_HV:
   657	      ######    		sv_catpv(tmpsv, ",HV");
   658					break;
   659				    }
   660	      ######    		if (o->op_private & OPpMAYBE_LVSUB)
   661	      ######    		    sv_catpv(tmpsv, ",MAYBE_LVSUB");
   662				    }
   663	      ######    	    if (o->op_type == OP_AELEM || o->op_type == OP_HELEM) {
   664	      ######    		if (o->op_private & OPpLVAL_DEFER)
   665	      ######    		    sv_catpv(tmpsv, ",LVAL_DEFER");
   666				    }
   667				    else {
   668	      ######    		if (o->op_private & HINT_STRICT_REFS)
   669	      ######    		    sv_catpv(tmpsv, ",STRICT_REFS");
   670	      ######    		if (o->op_private & OPpOUR_INTRO)
   671	      ######    		    sv_catpv(tmpsv, ",OUR_INTRO");
   672				    }
   673				}
   674	      ######    	else if (o->op_type == OP_CONST) {
   675	      ######    	    if (o->op_private & OPpCONST_BARE)
   676	      ######    		sv_catpv(tmpsv, ",BARE");
   677	      ######    	    if (o->op_private & OPpCONST_STRICT)
   678	      ######    		sv_catpv(tmpsv, ",STRICT");
   679	      ######    	    if (o->op_private & OPpCONST_ARYBASE)
   680	      ######    		sv_catpv(tmpsv, ",ARYBASE");
   681	      ######    	    if (o->op_private & OPpCONST_WARNING)
   682	      ######    		sv_catpv(tmpsv, ",WARNING");
   683	      ######    	    if (o->op_private & OPpCONST_ENTERED)
   684	      ######    		sv_catpv(tmpsv, ",ENTERED");
   685				}
   686	      ######    	else if (o->op_type == OP_FLIP) {
   687	      ######    	    if (o->op_private & OPpFLIP_LINENUM)
   688	      ######    		sv_catpv(tmpsv, ",LINENUM");
   689				}
   690	      ######    	else if (o->op_type == OP_FLOP) {
   691	      ######    	    if (o->op_private & OPpFLIP_LINENUM)
   692	      ######    		sv_catpv(tmpsv, ",LINENUM");
   693				}
   694	      ######    	else if (o->op_type == OP_RV2CV) {
   695	      ######    	    if (o->op_private & OPpLVAL_INTRO)
   696	      ######    		sv_catpv(tmpsv, ",INTRO");
   697				}
   698	      ######    	else if (o->op_type == OP_GV) {
   699	      ######    	    if (o->op_private & OPpEARLY_CV)
   700	      ######    		sv_catpv(tmpsv, ",EARLY_CV");
   701				}
   702	      ######    	else if (o->op_type == OP_LIST) {
   703	      ######    	    if (o->op_private & OPpLIST_GUESSED)
   704	      ######    		sv_catpv(tmpsv, ",GUESSED");
   705				}
   706	      ######    	else if (o->op_type == OP_DELETE) {
   707	      ######    	    if (o->op_private & OPpSLICE)
   708	      ######    		sv_catpv(tmpsv, ",SLICE");
   709				}
   710	      ######    	else if (o->op_type == OP_EXISTS) {
   711	      ######    	    if (o->op_private & OPpEXISTS_SUB)
   712	      ######    		sv_catpv(tmpsv, ",EXISTS_SUB");
   713				}
   714	      ######    	else if (o->op_type == OP_SORT) {
   715	      ######    	    if (o->op_private & OPpSORT_NUMERIC)
   716	      ######    		sv_catpv(tmpsv, ",NUMERIC");
   717	      ######    	    if (o->op_private & OPpSORT_INTEGER)
   718	      ######    		sv_catpv(tmpsv, ",INTEGER");
   719	      ######    	    if (o->op_private & OPpSORT_REVERSE)
   720	      ######    		sv_catpv(tmpsv, ",REVERSE");
   721				}
   722	      ######    	else if (o->op_type == OP_THREADSV) {
   723	      ######    	    if (o->op_private & OPpDONE_SVREF)
   724	      ######    		sv_catpv(tmpsv, ",SVREF");
   725				}
   726	      ######    	else if (o->op_type == OP_OPEN || o->op_type == OP_BACKTICK) {
   727	      ######    	    if (o->op_private & OPpOPEN_IN_RAW)
   728	      ######    		sv_catpv(tmpsv, ",IN_RAW");
   729	      ######    	    if (o->op_private & OPpOPEN_IN_CRLF)
   730	      ######    		sv_catpv(tmpsv, ",IN_CRLF");
   731	      ######    	    if (o->op_private & OPpOPEN_OUT_RAW)
   732	      ######    		sv_catpv(tmpsv, ",OUT_RAW");
   733	      ######    	    if (o->op_private & OPpOPEN_OUT_CRLF)
   734	      ######    		sv_catpv(tmpsv, ",OUT_CRLF");
   735				}
   736	      ######    	else if (o->op_type == OP_EXIT) {
   737	      ######    	    if (o->op_private & OPpEXIT_VMSISH)
   738	      ######    		sv_catpv(tmpsv, ",EXIT_VMSISH");
   739	      ######    	    if (o->op_private & OPpHUSH_VMSISH)
   740	      ######    		sv_catpv(tmpsv, ",HUSH_VMSISH");
   741				}
   742	      ######    	else if (o->op_type == OP_DIE) {
   743	      ######    	    if (o->op_private & OPpHUSH_VMSISH)
   744	      ######    		sv_catpv(tmpsv, ",HUSH_VMSISH");
   745				}
   746	      ######    	else if (PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)) {
   747	      ######    	    if (OP_IS_FILETEST_ACCESS(o) && o->op_private & OPpFT_ACCESS)
   748	      ######    		sv_catpv(tmpsv, ",FT_ACCESS");
   749	      ######    	    if (o->op_private & OPpFT_STACKED)
   750	      ######    		sv_catpv(tmpsv, ",FT_STACKED");
   751				}
   752	      ######    	if (o->op_flags & OPf_MOD && o->op_private & OPpLVAL_INTRO)
   753	      ######    	    sv_catpv(tmpsv, ",INTRO");
   754	      ######    	if (SvCUR(tmpsv))
   755	      ######    	    Perl_dump_indent(aTHX_ level, file, "PRIVATE = (%s)\n", SvPVX_const(tmpsv) + 1);
   756	      ######    	SvREFCNT_dec(tmpsv);
   757			    }
   758			
   759	      ######        switch (o->op_type) {
   760			    case OP_AELEMFAST:
   761			    case OP_GVSV:
   762			    case OP_GV:
   763			#ifdef USE_ITHREADS
   764				Perl_dump_indent(aTHX_ level, file, "PADIX = %" IVdf "\n", (IV)cPADOPo->op_padix);
   765			#else
   766	      ######    	if ( ! PL_op->op_flags & OPf_SPECIAL) { /* not lexical */
   767	      ######    	    if (cSVOPo->op_sv) {
   768	      ######    		SV *tmpsv = NEWSV(0,0);
   769	      ######    		ENTER;
   770	      ######    		SAVEFREESV(tmpsv);
   771	      ######    		gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, Nullch);
   772	      ######    		Perl_dump_indent(aTHX_ level, file, "GV = %s\n",
   773							 SvPV_nolen_const(tmpsv));
   774	      ######    		LEAVE;
   775				    }
   776				    else
   777	      ######    		Perl_dump_indent(aTHX_ level, file, "GV = NULL\n");
   778				}
   779			#endif
   780	      ######    	break;
   781			    case OP_CONST:
   782			    case OP_METHOD_NAMED:
   783			#ifndef USE_ITHREADS
   784				/* with ITHREADS, consts are stored in the pad, and the right pad
   785				 * may not be active here, so skip */
   786	      ######    	Perl_dump_indent(aTHX_ level, file, "SV = %s\n", SvPEEK(cSVOPo_sv));
   787			#endif
   788	      ######    	break;
   789			    case OP_SETSTATE:
   790			    case OP_NEXTSTATE:
   791			    case OP_DBSTATE:
   792	      ######    	if (CopLINE(cCOPo))
   793	      ######    	    Perl_dump_indent(aTHX_ level, file, "LINE = %"UVf"\n",
   794						     (UV)CopLINE(cCOPo));
   795	      ######    	if (CopSTASHPV(cCOPo))
   796	      ######    	    Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
   797						     CopSTASHPV(cCOPo));
   798	      ######    	if (cCOPo->cop_label)
   799	      ######    	    Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",
   800						     cCOPo->cop_label);
   801	      ######    	break;
   802			    case OP_ENTERLOOP:
   803	      ######    	Perl_dump_indent(aTHX_ level, file, "REDO ===> ");
   804	      ######    	if (cLOOPo->op_redoop)
   805	      ######    	    PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_redoop));
   806				else
   807	      ######    	    PerlIO_printf(file, "DONE\n");
   808	      ######    	Perl_dump_indent(aTHX_ level, file, "NEXT ===> ");
   809	      ######    	if (cLOOPo->op_nextop)
   810	      ######    	    PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_nextop));
   811				else
   812	      ######    	    PerlIO_printf(file, "DONE\n");
   813	      ######    	Perl_dump_indent(aTHX_ level, file, "LAST ===> ");
   814	      ######    	if (cLOOPo->op_lastop)
   815	      ######    	    PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_lastop));
   816				else
   817	      ######    	    PerlIO_printf(file, "DONE\n");
   818	      ######    	break;
   819			    case OP_COND_EXPR:
   820			    case OP_RANGE:
   821			    case OP_MAPWHILE:
   822			    case OP_GREPWHILE:
   823			    case OP_OR:
   824			    case OP_AND:
   825	      ######    	Perl_dump_indent(aTHX_ level, file, "OTHER ===> ");
   826	      ######    	if (cLOGOPo->op_other)
   827	      ######    	    PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOGOPo->op_other));
   828				else
   829	      ######    	    PerlIO_printf(file, "DONE\n");
   830	      ######    	break;
   831			    case OP_PUSHRE:
   832			    case OP_MATCH:
   833			    case OP_QR:
   834			    case OP_SUBST:
   835	      ######    	do_pmop_dump(level, file, cPMOPo);
   836	      ######    	break;
   837			    case OP_LEAVE:
   838			    case OP_LEAVEEVAL:
   839			    case OP_LEAVESUB:
   840			    case OP_LEAVESUBLV:
   841			    case OP_LEAVEWRITE:
   842			    case OP_SCOPE:
   843	      ######    	if (o->op_private & OPpREFCOUNTED)
   844	      ######    	    Perl_dump_indent(aTHX_ level, file, "REFCNT = %"UVuf"\n", (UV)o->op_targ);
   845				break;
   846			    default:
   847	      ######    	break;
   848			    }
   849	      ######        if (o->op_flags & OPf_KIDS) {
   850	      ######    	OP *kid;
   851	      ######    	for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling)
   852	      ######    	    do_op_dump(level, file, kid);
   853			    }
   854	      ######        Perl_dump_indent(aTHX_ level-1, file, "}\n");
   855			}
   856			
   857			void
   858			Perl_op_dump(pTHX_ const OP *o)
   859	      ######    {
   860	      ######        do_op_dump(0, Perl_debug_log, o);
   861			}
   862			
   863			void
   864			Perl_gv_dump(pTHX_ GV *gv)
   865	      ######    {
   866	      ######        SV *sv;
   867			
   868	      ######        if (!gv) {
   869	      ######    	PerlIO_printf(Perl_debug_log, "{}\n");
   870	      ######    	return;
   871			    }
   872	      ######        sv = sv_newmortal();
   873	      ######        PerlIO_printf(Perl_debug_log, "{\n");
   874	      ######        gv_fullname3(sv, gv, Nullch);
   875	      ######        Perl_dump_indent(aTHX_ 1, Perl_debug_log, "GV_NAME = %s", SvPVX_const(sv));
   876	      ######        if (gv != GvEGV(gv)) {
   877	      ######    	gv_efullname3(sv, GvEGV(gv), Nullch);
   878	      ######    	Perl_dump_indent(aTHX_ 1, Perl_debug_log, "-> %s", SvPVX_const(sv));
   879			    }
   880	      ######        PerlIO_putc(Perl_debug_log, '\n');
   881	      ######        Perl_dump_indent(aTHX_ 0, Perl_debug_log, "}\n");
   882			}
   883			
   884			
   885			/* map magic types to the symbolic names
   886			 * (with the PERL_MAGIC_ prefixed stripped)
   887			 */
   888			
   889			static const struct { const char type; const char *name; } magic_names[] = {
   890				{ PERL_MAGIC_sv,             "sv(\\0)" },
   891				{ PERL_MAGIC_arylen,         "arylen(#)" },
   892				{ PERL_MAGIC_rhash,          "rhash(%)" },
   893				{ PERL_MAGIC_glob,           "glob(*)" },
   894				{ PERL_MAGIC_pos,            "pos(.)" },
   895				{ PERL_MAGIC_symtab,         "symtab(:)" },
   896				{ PERL_MAGIC_backref,        "backref(<)" },
   897				{ PERL_MAGIC_arylen_p,       "arylen_p(@)" },
   898				{ PERL_MAGIC_overload,       "overload(A)" },
   899				{ PERL_MAGIC_bm,             "bm(B)" },
   900				{ PERL_MAGIC_regdata,        "regdata(D)" },
   901				{ PERL_MAGIC_env,            "env(E)" },
   902				{ PERL_MAGIC_isa,            "isa(I)" },
   903				{ PERL_MAGIC_dbfile,         "dbfile(L)" },
   904				{ PERL_MAGIC_shared,         "shared(N)" },
   905				{ PERL_MAGIC_tied,           "tied(P)" },
   906				{ PERL_MAGIC_sig,            "sig(S)" },
   907				{ PERL_MAGIC_uvar,           "uvar(U)" },
   908				{ PERL_MAGIC_overload_elem,  "overload_elem(a)" },
   909				{ PERL_MAGIC_overload_table, "overload_table(c)" },
   910				{ PERL_MAGIC_regdatum,       "regdatum(d)" },
   911				{ PERL_MAGIC_envelem,        "envelem(e)" },
   912				{ PERL_MAGIC_fm,             "fm(f)" },
   913				{ PERL_MAGIC_regex_global,   "regex_global(g)" },
   914				{ PERL_MAGIC_isaelem,        "isaelem(i)" },
   915				{ PERL_MAGIC_nkeys,          "nkeys(k)" },
   916				{ PERL_MAGIC_dbline,         "dbline(l)" },
   917				{ PERL_MAGIC_mutex,          "mutex(m)" },
   918				{ PERL_MAGIC_shared_scalar,  "shared_scalar(n)" },
   919				{ PERL_MAGIC_collxfrm,       "collxfrm(o)" },
   920				{ PERL_MAGIC_tiedelem,       "tiedelem(p)" },
   921				{ PERL_MAGIC_tiedscalar,     "tiedscalar(q)" },
   922				{ PERL_MAGIC_qr,             "qr(r)" },
   923				{ PERL_MAGIC_sigelem,        "sigelem(s)" },
   924				{ PERL_MAGIC_taint,          "taint(t)" },
   925				{ PERL_MAGIC_uvar_elem,      "uvar_elem(v)" },
   926				{ PERL_MAGIC_vec,            "vec(v)" },
   927				{ PERL_MAGIC_vstring,        "vstring(V)" },
   928				{ PERL_MAGIC_utf8,           "utf8(w)" },
   929				{ PERL_MAGIC_substr,         "substr(x)" },
   930				{ PERL_MAGIC_defelem,        "defelem(y)" },
   931				{ PERL_MAGIC_ext,            "ext(~)" },
   932				/* this null string terminates the list */
   933				{ 0,                         0 },
   934			};
   935			
   936			void
   937			Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
   938	           4    {
   939	          14        for (; mg; mg = mg->mg_moremagic) {
   940	           5     	Perl_dump_indent(aTHX_ level, file,
   941						 "  MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
   942	           5     	if (mg->mg_virtual) {
   943	           5                const MGVTBL * const v = mg->mg_virtual;
   944	           5     	    const char *s = 0;
   945	           5     	    if      (v == &PL_vtbl_sv)         s = "sv";
   946	           5                else if (v == &PL_vtbl_env)        s = "env";
   947	           5                else if (v == &PL_vtbl_envelem)    s = "envelem";
   948	           4                else if (v == &PL_vtbl_sig)        s = "sig";
   949	           4                else if (v == &PL_vtbl_sigelem)    s = "sigelem";
   950	           4                else if (v == &PL_vtbl_pack)       s = "pack";
   951	           4                else if (v == &PL_vtbl_packelem)   s = "packelem";
   952	           4                else if (v == &PL_vtbl_dbline)     s = "dbline";
   953	           4                else if (v == &PL_vtbl_isa)        s = "isa";
   954	           4                else if (v == &PL_vtbl_arylen)     s = "arylen";
   955	           4                else if (v == &PL_vtbl_glob)       s = "glob";
   956	           3                else if (v == &PL_vtbl_mglob)      s = "mglob";
   957	           2                else if (v == &PL_vtbl_nkeys)      s = "nkeys";
   958	           2                else if (v == &PL_vtbl_taint)      s = "taint";
   959	           1                else if (v == &PL_vtbl_substr)     s = "substr";
   960	           1                else if (v == &PL_vtbl_vec)        s = "vec";
   961	           1                else if (v == &PL_vtbl_pos)        s = "pos";
   962	           1                else if (v == &PL_vtbl_bm)         s = "bm";
   963	           1                else if (v == &PL_vtbl_fm)         s = "fm";
   964	           1                else if (v == &PL_vtbl_uvar)       s = "uvar";
   965	           1                else if (v == &PL_vtbl_defelem)    s = "defelem";
   966			#ifdef USE_LOCALE_COLLATE
   967	           1    	    else if (v == &PL_vtbl_collxfrm)   s = "collxfrm";
   968			#endif
   969	           1    	    else if (v == &PL_vtbl_amagic)     s = "amagic";
   970	           1    	    else if (v == &PL_vtbl_amagicelem) s = "amagicelem";
   971	           1    	    else if (v == &PL_vtbl_backref)    s = "backref";
   972	           1    	    else if (v == &PL_vtbl_utf8)       s = "utf8";
   973	           1                else if (v == &PL_vtbl_arylen_p)   s = "arylen_p";
   974	           5    	    if (s)
   975	           4    	        Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = &PL_vtbl_%s\n", s);
   976				    else
   977	           1    	        Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = 0x%"UVxf"\n", PTR2UV(v));
   978			        }
   979				else
   980	      ######    	    Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = 0\n");
   981			
   982	           5    	if (mg->mg_private)
   983	      ######    	    Perl_dump_indent(aTHX_ level, file, "    MG_PRIVATE = %d\n", mg->mg_private);
   984			
   985				{
   986	           5    	    int n;
   987	           5    	    const char *name = 0;
   988	         118    	    for (n = 0; magic_names[n].name; n++) {
   989	         118    		if (mg->mg_type == magic_names[n].type) {
   990	           5    		    name = magic_names[n].name;
   991	           5    		    break;
   992					}
   993				    }
   994	           5    	    if (name)
   995	           5    		Perl_dump_indent(aTHX_ level, file,
   996							"    MG_TYPE = PERL_MAGIC_%s\n", name);
   997				    else
   998	      ######    		Perl_dump_indent(aTHX_ level, file,
   999							"    MG_TYPE = UNKNOWN(\\%o)\n", mg->mg_type);
  1000				}
  1001			
  1002	           5            if (mg->mg_flags) {
  1003	           2                Perl_dump_indent(aTHX_ level, file, "    MG_FLAGS = 0x%02X\n", mg->mg_flags);
  1004	           2    	    if (mg->mg_type == PERL_MAGIC_envelem &&
  1005					mg->mg_flags & MGf_TAINTEDDIR)
  1006	           1    	        Perl_dump_indent(aTHX_ level, file, "      TAINTEDDIR\n");
  1007	           2    	    if (mg->mg_flags & MGf_REFCOUNTED)
  1008	      ######    	        Perl_dump_indent(aTHX_ level, file, "      REFCOUNTED\n");
  1009	           2                if (mg->mg_flags & MGf_GSKIP)
  1010	      ######    	        Perl_dump_indent(aTHX_ level, file, "      GSKIP\n");
  1011	           2    	    if (mg->mg_type == PERL_MAGIC_regex_global &&
  1012					mg->mg_flags & MGf_MINMATCH)
  1013	           1    	        Perl_dump_indent(aTHX_ level, file, "      MINMATCH\n");
  1014			        }
  1015	           5    	if (mg->mg_obj) {
  1016	           2    	    Perl_dump_indent(aTHX_ level, file, "    MG_OBJ = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
  1017	           2    	    if (mg->mg_flags & MGf_REFCOUNTED)
  1018	      ######    		do_sv_dump(level+2, file, mg->mg_obj, nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
  1019				}
  1020	           5            if (mg->mg_len)
  1021	           1    	    Perl_dump_indent(aTHX_ level, file, "    MG_LEN = %ld\n", (long)mg->mg_len);
  1022	           5            if (mg->mg_ptr) {
  1023	           1    	    Perl_dump_indent(aTHX_ level, file, "    MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr));
  1024	           1    	    if (mg->mg_len >= 0) {
  1025	           1    		if (mg->mg_type != PERL_MAGIC_utf8) {
  1026	           1    		    SV *sv = newSVpvn("", 0);
  1027	           1    		    PerlIO_printf(file, " %s", pv_display(sv, mg->mg_ptr, mg->mg_len, 0, pvlim));
  1028	           1    		    SvREFCNT_dec(sv);
  1029					}
  1030			            }
  1031	      ######    	    else if (mg->mg_len == HEf_SVKEY) {
  1032	      ######    		PerlIO_puts(file, " => HEf_SVKEY\n");
  1033	      ######    		do_sv_dump(level+2, file, (SV*)((mg)->mg_ptr), nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
  1034	      ######    		continue;
  1035				    }
  1036				    else
  1037	      ######    		PerlIO_puts(file, " ???? - please notify IZ");
  1038	           1                PerlIO_putc(file, '\n');
  1039			        }
  1040	           5    	if (mg->mg_type == PERL_MAGIC_utf8) {
  1041	      ######    	    STRLEN *cache = (STRLEN *) mg->mg_ptr;
  1042	      ######    	    if (cache) {
  1043	      ######    		IV i;
  1044	      ######    		for (i = 0; i < PERL_MAGIC_UTF8_CACHESIZE; i++)
  1045	      ######    		    Perl_dump_indent(aTHX_ level, file,
  1046							     "      %2"IVdf": %"UVuf" -> %"UVuf"\n",
  1047							     i,
  1048							     (UV)cache[i * 2],
  1049							     (UV)cache[i * 2 + 1]);
  1050				    }
  1051				}
  1052			    }
  1053			}
  1054			
  1055			void
  1056			Perl_magic_dump(pTHX_ const MAGIC *mg)
  1057	      ######    {
  1058	      ######        do_magic_dump(0, Perl_debug_log, mg, 0, 0, 0, 0);
  1059			}
  1060			
  1061			void
  1062			Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, const char *name, HV *sv)
  1063	           6    {
  1064	           6        const char *hvname;
  1065	           6        Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
  1066	           6        if (sv && (hvname = HvNAME_get(sv)))
  1067	           6    	PerlIO_printf(file, "\t\"%s\"\n", hvname);
  1068			    else
  1069	      ######    	PerlIO_putc(file, '\n');
  1070			}
  1071			
  1072			void
  1073			Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv)
  1074	           1    {
  1075	           1        Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
  1076	           1        if (sv && GvNAME(sv))
  1077	           1    	PerlIO_printf(file, "\t\"%s\"\n", GvNAME(sv));
  1078			    else
  1079	      ######    	PerlIO_putc(file, '\n');
  1080			}
  1081			
  1082			void
  1083			Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv)
  1084	           2    {
  1085	           2        Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
  1086	           2        if (sv && GvNAME(sv)) {
  1087	           2    	const char *hvname;
  1088	           2    	PerlIO_printf(file, "\t\"");
  1089	           2    	if (GvSTASH(sv) && (hvname = HvNAME_get(GvSTASH(sv))))
  1090	           2    	    PerlIO_printf(file, "%s\" :: \"", hvname);
  1091	           2    	PerlIO_printf(file, "%s\"\n", GvNAME(sv));
  1092			    }
  1093			    else
  1094	      ######    	PerlIO_putc(file, '\n');
  1095			}
  1096			
  1097			void
  1098			Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
  1099	          36    {
  1100	          36        SV *d;
  1101	          36        const char *s;
  1102	          36        U32 flags;
  1103	          36        U32 type;
  1104			
  1105	          36        if (!sv) {
  1106	      ######    	Perl_dump_indent(aTHX_ level, file, "SV = 0\n");
  1107	      ######    	return;
  1108			    }
  1109			
  1110	          36        flags = SvFLAGS(sv);
  1111	          36        type = SvTYPE(sv);
  1112			
  1113	          36        d = Perl_newSVpvf(aTHX_
  1114					   "(0x%"UVxf") at 0x%"UVxf"\n%*s  REFCNT = %"IVdf"\n%*s  FLAGS = (",
  1115					   PTR2UV(SvANY(sv)), PTR2UV(sv),
  1116					   (int)(PL_dumpindent*level), "", (IV)SvREFCNT(sv),
  1117					   (int)(PL_dumpindent*level), "");
  1118			
  1119	          36        if (flags & SVs_PADSTALE)	sv_catpv(d, "PADSTALE,");
  1120	          36        if (flags & SVs_PADTMP)	sv_catpv(d, "PADTMP,");
  1121	          36        if (flags & SVs_PADMY)	sv_catpv(d, "PADMY,");
  1122	          36        if (flags & SVs_TEMP)	sv_catpv(d, "TEMP,");
  1123	          36        if (flags & SVs_OBJECT)	sv_catpv(d, "OBJECT,");
  1124	          36        if (flags & SVs_GMG)	sv_catpv(d, "GMG,");
  1125	          36        if (flags & SVs_SMG)	sv_catpv(d, "SMG,");
  1126	          36        if (flags & SVs_RMG)	sv_catpv(d, "RMG,");
  1127			
  1128	          36        if (flags & SVf_IOK)	sv_catpv(d, "IOK,");
  1129	          36        if (flags & SVf_NOK)	sv_catpv(d, "NOK,");
  1130	          36        if (flags & SVf_POK)	sv_catpv(d, "POK,");
  1131	          36        if (flags & SVf_ROK)  {	
  1132	          10        				sv_catpv(d, "ROK,");
  1133	          10    	if (SvWEAKREF(sv))	sv_catpv(d, "WEAKREF,");
  1134			    }
  1135	          36        if (flags & SVf_OOK)	sv_catpv(d, "OOK,");
  1136	          36        if (flags & SVf_FAKE)	sv_catpv(d, "FAKE,");
  1137	          36        if (flags & SVf_READONLY)	sv_catpv(d, "READONLY,");
  1138			
  1139	          36        if (flags & SVf_AMAGIC && type != SVt_PVHV)
  1140	      ######    				sv_catpv(d, "OVERLOAD,");
  1141	          36        if (flags & SVp_IOK)	sv_catpv(d, "pIOK,");
  1142	          36        if (flags & SVp_NOK)	sv_catpv(d, "pNOK,");
  1143	          36        if (flags & SVp_POK)	sv_catpv(d, "pPOK,");
  1144	          36        if (flags & SVp_SCREAM && type != SVt_PVHV)
  1145	      ######    				sv_catpv(d, "SCREAM,");
  1146			
  1147	          36        switch (type) {
  1148			    case SVt_PVCV:
  1149			    case SVt_PVFM:
  1150	           2    	if (CvANON(sv))		sv_catpv(d, "ANON,");
  1151	           2    	if (CvUNIQUE(sv))	sv_catpv(d, "UNIQUE,");
  1152	           2    	if (CvCLONE(sv))	sv_catpv(d, "CLONE,");
  1153	           2    	if (CvCLONED(sv))	sv_catpv(d, "CLONED,");
  1154	           2    	if (CvCONST(sv))	sv_catpv(d, "CONST,");
  1155	           2    	if (CvNODEBUG(sv))	sv_catpv(d, "NODEBUG,");
  1156	           2    	if (SvCOMPILED(sv))	sv_catpv(d, "COMPILED,");
  1157	           2    	if (CvLVALUE(sv))	sv_catpv(d, "LVALUE,");
  1158	           2    	if (CvMETHOD(sv))	sv_catpv(d, "METHOD,");
  1159	           2    	if (CvLOCKED(sv))	sv_catpv(d, "LOCKED,");
  1160	           2    	if (CvWEAKOUTSIDE(sv))	sv_catpv(d, "WEAKOUTSIDE,");
  1161	           2    	if (CvASSERTION(sv))    sv_catpv(d, "ASSERTION,");
  1162	      ######    	break;
  1163			    case SVt_PVHV:
  1164	           3    	if (HvSHAREKEYS(sv))	sv_catpv(d, "SHAREKEYS,");
  1165	           3    	if (HvLAZYDEL(sv))	sv_catpv(d, "LAZYDEL,");
  1166	           3    	if (HvHASKFLAGS(sv))	sv_catpv(d, "HASKFLAGS,");
  1167	           3    	if (HvREHASH(sv))	sv_catpv(d, "REHASH,");
  1168	           3    	if (flags & SVphv_CLONEABLE) sv_catpv(d, "CLONEABLE,");
  1169	      ######    	break;
  1170			    case SVt_PVGV: case SVt_PVLV:
  1171	           1    	if (GvINTRO(sv))	sv_catpv(d, "INTRO,");
  1172	           1    	if (GvMULTI(sv))	sv_catpv(d, "MULTI,");
  1173	           1    	if (GvUNIQUE(sv))       sv_catpv(d, "UNIQUE,");
  1174	           1    	if (GvASSUMECV(sv))	sv_catpv(d, "ASSUMECV,");
  1175	           1    	if (GvIN_PAD(sv))       sv_catpv(d, "IN_PAD,");
  1176	           1    	if (flags & SVpad_OUR)	sv_catpv(d, "OUR,");
  1177	           1    	if (GvIMPORTED(sv)) {
  1178	      ######    	    sv_catpv(d, "IMPORT");
  1179	      ######    	    if (GvIMPORTED(sv) == GVf_IMPORTED)
  1180	      ######    		sv_catpv(d, "ALL,");
  1181				    else {
  1182	      ######    		sv_catpv(d, "(");
  1183	      ######    		if (GvIMPORTED_SV(sv))	sv_catpv(d, " SV");
  1184	      ######    		if (GvIMPORTED_AV(sv))	sv_catpv(d, " AV");
  1185	      ######    		if (GvIMPORTED_HV(sv))	sv_catpv(d, " HV");
  1186	      ######    		if (GvIMPORTED_CV(sv))	sv_catpv(d, " CV");
  1187	      ######    		sv_catpv(d, " ),");
  1188				    }
  1189				}
  1190				/* FALL THROUGH */
  1191			    default:
  1192	          26    	if (SvEVALED(sv))	sv_catpv(d, "EVALED,");
  1193	          26    	if (SvIsUV(sv) && !(flags & SVf_ROK))	sv_catpv(d, "IsUV,");
  1194	      ######    	break;
  1195			    case SVt_PVBM:
  1196	      ######    	if (SvTAIL(sv))		sv_catpv(d, "TAIL,");
  1197	      ######    	if (SvVALID(sv))	sv_catpv(d, "VALID,");
  1198	      ######    	break;
  1199			    case SVt_PVMG:
  1200	           4    	if (flags & SVpad_TYPED)
  1201	      ######    				sv_catpv(d, "TYPED,");
  1202				break;
  1203			    case SVt_PVAV:
  1204	          36    	break;
  1205			    }
  1206			    /* SVphv_SHAREKEYS is also 0x20000000 */
  1207	          36        if ((type != SVt_PVHV) && SvUTF8(sv))
  1208	           2            sv_catpv(d, "UTF8");
  1209			
  1210	          36        if (*(SvEND(d) - 1) == ',') {
  1211	          31            SvCUR_set(d, SvCUR(d) - 1);
  1212	          31    	SvPVX(d)[SvCUR(d)] = '\0';
  1213			    }
  1214	          36        sv_catpv(d, ")");
  1215	          36        s = SvPVX_const(d);
  1216			
  1217			#ifdef DEBUG_LEAKING_SCALARS
  1218			    Perl_dump_indent(aTHX_ level, file, "ALLOCATED at %s:%d %s %s%s\n",
  1219				sv->sv_debug_file ? sv->sv_debug_file : "(unknown)",
  1220				sv->sv_debug_line,
  1221				sv->sv_debug_inpad ? "for" : "by",
  1222				sv->sv_debug_optype ? PL_op_name[sv->sv_debug_optype]: "(none)",
  1223				sv->sv_debug_cloned ? " (cloned)" : "");
  1224			#endif
  1225	          36        Perl_dump_indent(aTHX_ level, file, "SV = ");
  1226	          36        switch (type) {
  1227			    case SVt_NULL:
  1228	           2    	PerlIO_printf(file, "NULL%s\n", s);
  1229	           2    	SvREFCNT_dec(d);
  1230	      ######    	return;
  1231			    case SVt_IV:
  1232	           8    	PerlIO_printf(file, "IV%s\n", s);
  1233	           8    	break;
  1234			    case SVt_NV:
  1235	      ######    	PerlIO_printf(file, "NV%s\n", s);
  1236	      ######    	break;
  1237			    case SVt_RV:
  1238	           9    	PerlIO_printf(file, "RV%s\n", s);
  1239	           9    	break;
  1240			    case SVt_PV:
  1241	           5    	PerlIO_printf(file, "PV%s\n", s);
  1242	           5    	break;
  1243			    case SVt_PVIV:
  1244	      ######    	PerlIO_printf(file, "PVIV%s\n", s);
  1245	      ######    	break;
  1246			    case SVt_PVNV:
  1247	           1    	PerlIO_printf(file, "PVNV%s\n", s);
  1248	           1    	break;
  1249			    case SVt_PVBM:
  1250	      ######    	PerlIO_printf(file, "PVBM%s\n", s);
  1251	      ######    	break;
  1252			    case SVt_PVMG:
  1253	           4    	PerlIO_printf(file, "PVMG%s\n", s);
  1254	           4    	break;
  1255			    case SVt_PVLV:
  1256	      ######    	PerlIO_printf(file, "PVLV%s\n", s);
  1257	      ######    	break;
  1258			    case SVt_PVAV:
  1259	           1    	PerlIO_printf(file, "PVAV%s\n", s);
  1260	           1    	break;
  1261			    case SVt_PVHV:
  1262	           3    	PerlIO_printf(file, "PVHV%s\n", s);
  1263	           3    	break;
  1264			    case SVt_PVCV:
  1265	           2    	PerlIO_printf(file, "PVCV%s\n", s);
  1266	           2    	break;
  1267			    case SVt_PVGV:
  1268	           1    	PerlIO_printf(file, "PVGV%s\n", s);
  1269	           1    	break;
  1270			    case SVt_PVFM:
  1271	      ######    	PerlIO_printf(file, "PVFM%s\n", s);
  1272	      ######    	break;
  1273			    case SVt_PVIO:
  1274	      ######    	PerlIO_printf(file, "PVIO%s\n", s);
  1275	      ######    	break;
  1276			    default:
  1277	      ######    	PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s);
  1278	      ######    	SvREFCNT_dec(d);
  1279	      ######    	return;
  1280			    }
  1281	          34        if ((type >= SVt_PVIV && type != SVt_PVAV && type != SVt_PVHV)
  1282				|| type == SVt_IV) {
  1283	          16    	if (SvIsUV(sv)
  1284			#ifdef PERL_OLD_COPY_ON_WRITE
  1285				               || SvIsCOW(sv)
  1286			#endif
  1287				                             )
  1288	      ######    	    Perl_dump_indent(aTHX_ level, file, "  UV = %"UVuf, (UV)SvUVX(sv));
  1289				else
  1290	          16    	    Perl_dump_indent(aTHX_ level, file, "  IV = %"IVdf, (IV)SvIVX(sv));
  1291	          16    	if (SvOOK(sv))
  1292	      ######    	    PerlIO_printf(file, "  (OFFSET)");
  1293			#ifdef PERL_OLD_COPY_ON_WRITE
  1294				if (SvIsCOW_shared_hash(sv))
  1295				    PerlIO_printf(file, "  (HASH)");
  1296				else if (SvIsCOW_normal(sv))
  1297				    PerlIO_printf(file, "  (COW from 0x%"UVxf")", (UV)SvUVX(sv));
  1298			#endif
  1299	          16    	PerlIO_putc(file, '\n');
  1300			    }
  1301	          34        if ((type >= SVt_PVNV && type != SVt_PVAV && type != SVt_PVHV)
  1302				|| type == SVt_NV) {
  1303	           8    	STORE_NUMERIC_LOCAL_SET_STANDARD();
  1304				/* %Vg doesn't work? --jhi */
  1305			#ifdef USE_LONG_DOUBLE
  1306				Perl_dump_indent(aTHX_ level, file, "  NV = %.*" PERL_PRIgldbl "\n", LDBL_DIG, SvNVX(sv));
  1307			#else
  1308	           8    	Perl_dump_indent(aTHX_ level, file, "  NV = %.*g\n", DBL_DIG, SvNVX(sv));
  1309			#endif
  1310	           8    	RESTORE_NUMERIC_LOCAL();
  1311			    }
  1312	          34        if (SvROK(sv)) {
  1313	          10    	Perl_dump_indent(aTHX_ level, file, "  RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv)));
  1314	          10    	if (nest < maxnest)
  1315	          10    	    do_sv_dump(level+1, file, SvRV(sv), nest+1, maxnest, dumpops, pvlim);
  1316			    }
  1317	          34        if (type < SVt_PV) {
  1318	          17    	SvREFCNT_dec(d);
  1319	      ######    	return;
  1320			    }
  1321	          17        if (type <= SVt_PVLV && type != SVt_PVGV) {
  1322	          10    	if (SvPVX_const(sv)) {
  1323	           9    	    Perl_dump_indent(aTHX_ level, file,"  PV = 0x%"UVxf" ", PTR2UV(SvPVX_const(sv)));
  1324	           9    	    if (SvOOK(sv))
  1325	      ######    		PerlIO_printf(file, "( %s . ) ", pv_display(d, SvPVX_const(sv)-SvIVX(sv), SvIVX(sv), 0, pvlim));
  1326	           9    	    PerlIO_printf(file, "%s", pv_display(d, SvPVX_const(sv), SvCUR(sv), SvLEN(sv), pvlim));
  1327	           9    	    if (SvUTF8(sv)) /* the 8?  \x{....} */
  1328	           2    	        PerlIO_printf(file, " [UTF8 \"%s\"]", sv_uni_display(d, sv, 8 * sv_len_utf8(sv), UNI_DISPLAY_QQ));
  1329	           9    	    PerlIO_printf(file, "\n");
  1330	           9    	    Perl_dump_indent(aTHX_ level, file, "  CUR = %"IVdf"\n", (IV)SvCUR(sv));
  1331	           9    	    Perl_dump_indent(aTHX_ level, file, "  LEN = %"IVdf"\n", (IV)SvLEN(sv));
  1332				}
  1333				else
  1334	           1    	    Perl_dump_indent(aTHX_ level, file, "  PV = 0\n");
  1335			    }
  1336	          17        if (type >= SVt_PVMG) {
  1337	          11    	if (SvMAGIC(sv))
  1338	           4                do_magic_dump(level, file, SvMAGIC(sv), nest, maxnest, dumpops, pvlim);
  1339	          11    	if (SvSTASH(sv))
  1340	           3    	    do_hv_dump(level, file, "  STASH", SvSTASH(sv));
  1341			    }
  1342	          17        switch (type) {
  1343			    case SVt_PVAV:
  1344	           1    	Perl_dump_indent(aTHX_ level, file, "  ARRAY = 0x%"UVxf, PTR2UV(AvARRAY(sv)));
  1345	           1    	if (AvARRAY(sv) != AvALLOC(sv)) {
  1346	      ######    	    PerlIO_printf(file, " (offset=%"IVdf")\n", (IV)(AvARRAY(sv) - AvALLOC(sv)));
  1347	      ######    	    Perl_dump_indent(aTHX_ level, file, "  ALLOC = 0x%"UVxf"\n", PTR2UV(AvALLOC(sv)));
  1348				}
  1349				else
  1350	           1    	    PerlIO_putc(file, '\n');
  1351	           1    	Perl_dump_indent(aTHX_ level, file, "  FILL = %"IVdf"\n", (IV)AvFILLp(sv));
  1352	           1    	Perl_dump_indent(aTHX_ level, file, "  MAX = %"IVdf"\n", (IV)AvMAX(sv));
  1353	           1    	Perl_dump_indent(aTHX_ level, file, "  ARYLEN = 0x%"UVxf"\n", SvMAGIC(sv) ? PTR2UV(AvARYLEN(sv)) : 0);
  1354	           1    	sv_setpvn(d, "", 0);
  1355	           1    	if (AvREAL(sv))	sv_catpv(d, ",REAL");
  1356	           1    	if (AvREIFY(sv))	sv_catpv(d, ",REIFY");
  1357	           1    	Perl_dump_indent(aTHX_ level, file, "  FLAGS = (%s)\n",
  1358						 SvCUR(d) ? SvPVX_const(d) + 1 : "");
  1359	           1    	if (nest < maxnest && av_len((AV*)sv) >= 0) {
  1360	           1    	    int count;
  1361	           3    	    for (count = 0; count <=  av_len((AV*)sv) && count < maxnest; count++) {
  1362	           2    		SV** elt = av_fetch((AV*)sv,count,0);
  1363			
  1364	           2    		Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %"IVdf"\n", (IV)count);
  1365	           2    		if (elt)
  1366	           2    		    do_sv_dump(level+1, file, *elt, nest+1, maxnest, dumpops, pvlim);
  1367				    }
  1368				}
  1369	           3    	break;
  1370			    case SVt_PVHV:
  1371	           3    	Perl_dump_indent(aTHX_ level, file, "  ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
  1372	           3    	if (HvARRAY(sv) && HvKEYS(sv)) {
  1373				    /* Show distribution of HEs in the ARRAY */
  1374	           2    	    int freq[200];
  1375			#define FREQ_MAX (sizeof freq / sizeof freq[0] - 1)
  1376	           2    	    int i;
  1377	           2    	    int max = 0;
  1378	           2    	    U32 pow2 = 2, keys = HvKEYS(sv);
  1379	           2    	    NV theoret, sum = 0;
  1380			
  1381	           2    	    PerlIO_printf(file, "  (");
  1382	           2    	    Zero(freq, FREQ_MAX + 1, int);
  1383	          18    	    for (i = 0; (STRLEN)i <= HvMAX(sv); i++) {
  1384	          16    		HE* h; int count = 0;
  1385	          18                    for (h = HvARRAY(sv)[i]; h; h = HeNEXT(h))
  1386	           2    		    count++;
  1387	          16    		if (count > FREQ_MAX)
  1388	      ######    		    count = FREQ_MAX;
  1389	          16    	        freq[count]++;
  1390	          16    	        if (max < count)
  1391	           2    		    max = count;
  1392				    }
  1393	           6    	    for (i = 0; i <= max; i++) {
  1394	           4    		if (freq[i]) {
  1395	           4    		    PerlIO_printf(file, "%d%s:%d", i,
  1396							  (i == FREQ_MAX) ? "+" : "",
  1397							  freq[i]);
  1398	           4    		    if (i != max)
  1399	           2    			PerlIO_printf(file, ", ");
  1400					}
  1401			            }
  1402	           2    	    PerlIO_putc(file, ')');
  1403				    /* The "quality" of a hash is defined as the total number of
  1404				       comparisons needed to access every element once, relative
  1405				       to the expected number needed for a random hash.
  1406			
  1407				       The total number of comparisons is equal to the sum of
  1408				       the squares of the number of entries in each bucket.
  1409				       For a random hash of n keys into k buckets, the expected
  1410				       value is
  1411							n + n(n-1)/2k
  1412				    */
  1413			
  1414	           4    	    for (i = max; i > 0; i--) { /* Precision: count down. */
  1415	           2    		sum += freq[i] * i * i;
  1416			            }
  1417	           2    	    while ((keys = keys >> 1))
  1418	      ######    		pow2 = pow2 << 1;
  1419	           2    	    theoret = HvKEYS(sv);
  1420	           2    	    theoret += theoret * (theoret-1)/pow2;
  1421	           2    	    PerlIO_putc(file, '\n');
  1422	           2    	    Perl_dump_indent(aTHX_ level, file, "  hash quality = %.1"NVff"%%", theoret/sum*100);
  1423				}
  1424	           3    	PerlIO_putc(file, '\n');
  1425	           3    	Perl_dump_indent(aTHX_ level, file, "  KEYS = %"IVdf"\n", (IV)HvKEYS(sv));
  1426	           3    	Perl_dump_indent(aTHX_ level, file, "  FILL = %"IVdf"\n", (IV)HvFILL(sv));
  1427	           3    	Perl_dump_indent(aTHX_ level, file, "  MAX = %"IVdf"\n", (IV)HvMAX(sv));
  1428	           3    	Perl_dump_indent(aTHX_ level, file, "  RITER = %"IVdf"\n", (IV)HvRITER_get(sv));
  1429	           3    	Perl_dump_indent(aTHX_ level, file, "  EITER = 0x%"UVxf"\n", PTR2UV(HvEITER_get(sv)));
  1430				{
  1431	           3    	    MAGIC *mg = mg_find(sv, PERL_MAGIC_symtab);
  1432	           3    	    if (mg && mg->mg_obj) {
  1433	      ######    		Perl_dump_indent(aTHX_ level, file, "  PMROOT = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
  1434				    }
  1435				}
  1436				{
  1437	           3    	    const char *hvname = HvNAME_get(sv);
  1438	           3    	    if (hvname)
  1439	      ######    		Perl_dump_indent(aTHX_ level, file, "  NAME = \"%s\"\n", hvname);
  1440				}
  1441	           3    	if (nest < maxnest && !HvEITER_get(sv)) { /* Try to preserve iterator */
  1442	           3    	    HE *he;
  1443	           3    	    HV *hv = (HV*)sv;
  1444	           3    	    int count = maxnest - nest;
  1445			
  1446	           3    	    hv_iterinit(hv);
  1447	           5    	    while ((he = hv_iternext_flags(hv, HV_ITERNEXT_WANTPLACEHOLDERS))
  1448			                   && count--) {
  1449	           2    		SV *elt, *keysv;
  1450	           2                    const char *keypv;
  1451	           2    		STRLEN len;
  1452	           2    		U32 hash = HeHASH(he);
  1453			
  1454	           2    		keysv = hv_iterkeysv(he);
  1455	           2    		keypv = SvPV_const(keysv, len);
  1456	           2    		elt = hv_iterval(hv, he);
  1457	           2    		Perl_dump_indent(aTHX_ level+1, file, "Elt %s ", pv_display(d, keypv, len, 0, pvlim));
  1458	           2    		if (SvUTF8(keysv))
  1459	           1    		    PerlIO_printf(file, "[UTF8 \"%s\"] ", sv_uni_display(d, keysv, 8 * sv_len_utf8(keysv), UNI_DISPLAY_QQ));
  1460	           2    		if (HeKREHASH(he))
  1461	      ######    		    PerlIO_printf(file, "[REHASH] ");
  1462	           2    		PerlIO_printf(file, "HASH = 0x%"UVxf"\n", (UV)hash);
  1463	           2    		do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
  1464				    }
  1465	           3    	    hv_iterinit(hv);		/* Return to status quo */
  1466				}
  1467	           3    	break;
  1468			    case SVt_PVCV:
  1469	           2    	if (SvPOK(sv))
  1470	           1    	    Perl_dump_indent(aTHX_ level, file, "  PROTOTYPE = \"%s\"\n", SvPV_nolen_const(sv));
  1471				/* FALL THROUGH */
  1472			    case SVt_PVFM:
  1473	           2    	do_hv_dump(level, file, "  COMP_STASH", CvSTASH(sv));
  1474	           2    	if (CvSTART(sv))
  1475	           2    	    Perl_dump_indent(aTHX_ level, file, "  START = 0x%"UVxf" ===> %"IVdf"\n", PTR2UV(CvSTART(sv)), (IV)sequence_num(aTHX_ CvSTART(sv)));
  1476	           2    	Perl_dump_indent(aTHX_ level, file, "  ROOT = 0x%"UVxf"\n", PTR2UV(CvROOT(sv)));
  1477	           2            if (CvROOT(sv) && dumpops)
  1478	      ######    	    do_op_dump(level+1, file, CvROOT(sv));
  1479	           2    	Perl_dump_indent(aTHX_ level, file, "  XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
  1480	           2    	Perl_dump_indent(aTHX_ level, file, "  XSUBANY = %"IVdf"\n", (IV)CvXSUBANY(sv).any_i32);
  1481	           2     	do_gvgv_dump(level, file, "  GVGV::GV", CvGV(sv));
  1482	           2    	Perl_dump_indent(aTHX_ level, file, "  FILE = \"%s\"\n", CvFILE(sv));
  1483	           2    	Perl_dump_indent(aTHX_ level, file, "  DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
  1484	           2    	Perl_dump_indent(aTHX_ level, file, "  FLAGS = 0x%"UVxf"\n", (UV)CvFLAGS(sv));
  1485	           2    	Perl_dump_indent(aTHX_ level, file, "  OUTSIDE_SEQ = %"UVuf"\n", (UV)CvOUTSIDE_SEQ(sv));
  1486	           2    	if (type == SVt_PVFM)
  1487	      ######    	    Perl_dump_indent(aTHX_ level, file, "  LINES = %"IVdf"\n", (IV)FmLINES(sv));
  1488	           2    	Perl_dump_indent(aTHX_ level, file, "  PADLIST = 0x%"UVxf"\n", PTR2UV(CvPADLIST(sv)));
  1489	           2    	if (nest < maxnest) {
  1490	           2    	    do_dump_pad(level+1, file, CvPADLIST(sv), 0);
  1491				}
  1492				{
  1493	           2                const CV *outside = CvOUTSIDE(sv);
  1494	           2    	    Perl_dump_indent(aTHX_ level, file, "  OUTSIDE = 0x%"UVxf" (%s)\n",
  1495						PTR2UV(outside),
  1496						(!outside ? "null"
  1497						 : CvANON(outside) ? "ANON"
  1498						 : (outside == PL_main_cv) ? "MAIN"
  1499						 : CvUNIQUE(outside) ? "UNIQUE"
  1500						 : CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
  1501				}
  1502	           2    	if (nest < maxnest && (CvCLONE(sv) || CvCLONED(sv)))
  1503	      ######    	    do_sv_dump(level+1, file, (SV*)CvOUTSIDE(sv), nest+1, maxnest, dumpops, pvlim);
  1504	      ######    	break;
  1505			    case SVt_PVGV: case SVt_PVLV:
  1506	           1        if (type == SVt_PVLV) {
  1507	      ######            Perl_dump_indent(aTHX_ level, file, "  TYPE = %c\n", LvTYPE(sv));
  1508	      ######            Perl_dump_indent(aTHX_ level, file, "  TARGOFF = %"IVdf"\n", (IV)LvTARGOFF(sv));
  1509	      ######            Perl_dump_indent(aTHX_ level, file, "  TARGLEN = %"IVdf"\n", (IV)LvTARGLEN(sv));
  1510	      ######            Perl_dump_indent(aTHX_ level, file, "  TARG = 0x%"UVxf"\n", PTR2UV(LvTARG(sv)));
  1511	      ######            if (LvTYPE(sv) != 't' && LvTYPE(sv) != 'T')
  1512	      ######                do_sv_dump(level+1, file, LvTARG(sv), nest+1, maxnest,
  1513			                dumpops, pvlim);
  1514			    }
  1515	           1    	Perl_dump_indent(aTHX_ level, file, "  NAME = \"%s\"\n", GvNAME(sv));
  1516	           1    	Perl_dump_indent(aTHX_ level, file, "  NAMELEN = %"IVdf"\n", (IV)GvNAMELEN(sv));
  1517	           1    	do_hv_dump (level, file, "  GvSTASH", GvSTASH(sv));
  1518	           1    	Perl_dump_indent(aTHX_ level, file, "  GP = 0x%"UVxf"\n", PTR2UV(GvGP(sv)));
  1519	           1    	if (!GvGP(sv))
  1520	      ######    	    break;
  1521	           1    	Perl_dump_indent(aTHX_ level, file, "    SV = 0x%"UVxf"\n", PTR2UV(GvSV(sv)));
  1522	           1    	Perl_dump_indent(aTHX_ level, file, "    REFCNT = %"IVdf"\n", (IV)GvREFCNT(sv));
  1523	           1    	Perl_dump_indent(aTHX_ level, file, "    IO = 0x%"UVxf"\n", PTR2UV(GvIOp(sv)));
  1524	           1    	Perl_dump_indent(aTHX_ level, file, "    FORM = 0x%"UVxf"  \n", PTR2UV(GvFORM(sv)));
  1525	           1    	Perl_dump_indent(aTHX_ level, file, "    AV = 0x%"UVxf"\n", PTR2UV(GvAV(sv)));
  1526	           1    	Perl_dump_indent(aTHX_ level, file, "    HV = 0x%"UVxf"\n", PTR2UV(GvHV(sv)));
  1527	           1    	Perl_dump_indent(aTHX_ level, file, "    CV = 0x%"UVxf"\n", PTR2UV(GvCV(sv)));
  1528	           1    	Perl_dump_indent(aTHX_ level, file, "    CVGEN = 0x%"UVxf"\n", (UV)GvCVGEN(sv));
  1529	           1    	Perl_dump_indent(aTHX_ level, file, "    LINE = %"IVdf"\n", (IV)GvLINE(sv));
  1530	           1    	Perl_dump_indent(aTHX_ level, file, "    FILE = \"%s\"\n", GvFILE(sv));
  1531	           1    	Perl_dump_indent(aTHX_ level, file, "    FLAGS = 0x%"UVxf"\n", (UV)GvFLAGS(sv));
  1532	           1    	do_gv_dump (level, file, "    EGV", GvEGV(sv));
  1533	           1    	break;
  1534			    case SVt_PVIO:
  1535	      ######    	Perl_dump_indent(aTHX_ level, file, "  IFP = 0x%"UVxf"\n", PTR2UV(IoIFP(sv)));
  1536	      ######    	Perl_dump_indent(aTHX_ level, file, "  OFP = 0x%"UVxf"\n", PTR2UV(IoOFP(sv)));
  1537	      ######    	Perl_dump_indent(aTHX_ level, file, "  DIRP = 0x%"UVxf"\n", PTR2UV(IoDIRP(sv)));
  1538	      ######    	Perl_dump_indent(aTHX_ level, file, "  LINES = %"IVdf"\n", (IV)IoLINES(sv));
  1539	      ######    	Perl_dump_indent(aTHX_ level, file, "  PAGE = %"IVdf"\n", (IV)IoPAGE(sv));
  1540	      ######    	Perl_dump_indent(aTHX_ level, file, "  PAGE_LEN = %"IVdf"\n", (IV)IoPAGE_LEN(sv));
  1541	      ######    	Perl_dump_indent(aTHX_ level, file, "  LINES_LEFT = %"IVdf"\n", (IV)IoLINES_LEFT(sv));
  1542	      ######            if (IoTOP_NAME(sv))
  1543	      ######                Perl_dump_indent(aTHX_ level, file, "  TOP_NAME = \"%s\"\n", IoTOP_NAME(sv));
  1544	      ######    	do_gv_dump (level, file, "  TOP_GV", IoTOP_GV(sv));
  1545	      ######            if (IoFMT_NAME(sv))
  1546	      ######                Perl_dump_indent(aTHX_ level, file, "  FMT_NAME = \"%s\"\n", IoFMT_NAME(sv));
  1547	      ######    	do_gv_dump (level, file, "  FMT_GV", IoFMT_GV(sv));
  1548	      ######            if (IoBOTTOM_NAME(sv))
  1549	      ######                Perl_dump_indent(aTHX_ level, file, "  BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
  1550	      ######    	do_gv_dump (level, file, "  BOTTOM_GV", IoBOTTOM_GV(sv));
  1551	      ######    	Perl_dump_indent(aTHX_ level, file, "  SUBPROCESS = %"IVdf"\n", (IV)IoSUBPROCESS(sv));
  1552	      ######    	if (isPRINT(IoTYPE(sv)))
  1553	      ######                Perl_dump_indent(aTHX_ level, file, "  TYPE = '%c'\n", IoTYPE(sv));
  1554				else
  1555	      ######                Perl_dump_indent(aTHX_ level, file, "  TYPE = '\\%o'\n", IoTYPE(sv));
  1556	      ######    	Perl_dump_indent(aTHX_ level, file, "  FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv));
  1557				break;
  1558			    }
  1559	          17        SvREFCNT_dec(d);
  1560			}
  1561			
  1562			void
  1563			Perl_sv_dump(pTHX_ SV *sv)
  1564	      ######    {
  1565	      ######        do_sv_dump(0, Perl_debug_log, sv, 0, 0, 0, 0);
  1566			}
  1567			
  1568			int
  1569			Perl_runops_debug(pTHX)
  1570	     3243565    {
  1571	     3243565        if (!PL_op) {
  1572	      ######    	if (ckWARN_d(WARN_DEBUGGING))
  1573	      ######    	    Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), "NULL OP IN RUN");
  1574	      ######    	return 0;
  1575			    }
  1576			
  1577	     3243565        DEBUG_l(Perl_deb(aTHX_ "Entering new RUNOPS level\n"));
  1578	  1118702629        do {
  1579	  1118702629    	PERL_ASYNC_CHECK();
  1580	  1118702626    	if (PL_debug) {
  1581	          12    	    if (PL_watchaddr != 0 && *PL_watchaddr != PL_watchok)
  1582	      ######    		PerlIO_printf(Perl_debug_log,
  1583						      "WARNING: %"UVxf" changed from %"UVxf" to %"UVxf"\n",
  1584						      PTR2UV(PL_watchaddr), PTR2UV(PL_watchok),
  1585						      PTR2UV(*PL_watchaddr));
  1586	          12    	    if (DEBUG_s_TEST_) {
  1587	      ######    		if (DEBUG_v_TEST_) {
  1588	      ######    		    PerlIO_printf(Perl_debug_log, "\n");
  1589	      ######    		    deb_stack_all();
  1590					}
  1591					else
  1592	      ######    		    debstack();
  1593				    }
  1594			
  1595			
  1596	          12    	    if (DEBUG_t_TEST_) debop(PL_op);
  1597	          12    	    if (DEBUG_P_TEST_) debprof(PL_op);
  1598				}
  1599	  1118702626        } while ((PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX)));
  1600	     3238526        DEBUG_l(Perl_deb(aTHX_ "leaving RUNOPS level\n"));
  1601			
  1602	     3238526        TAINT_NOT;
  1603	     3238526        return 0;
  1604			}
  1605			
  1606			I32
  1607			Perl_debop(pTHX_ const OP *o)
  1608	          12    {
  1609	          12        if (CopSTASH_eq(PL_curcop, PL_debstash) && !DEBUG_J_TEST_)
  1610	      ######    	return 0;
  1611			
  1612	          12        Perl_deb(aTHX_ "%s", OP_NAME(o));
  1613	          12        switch (o->op_type) {
  1614			    case OP_CONST:
  1615	           1    	PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo_sv));
  1616	           1    	break;
  1617			    case OP_GVSV:
  1618			    case OP_GV:
  1619	           3    	if (cGVOPo_gv) {
  1620	           3    	    SV *sv = NEWSV(0,0);
  1621	           3    	    gv_fullname3(sv, cGVOPo_gv, Nullch);
  1622	           3    	    PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
  1623	           3    	    SvREFCNT_dec(sv);
  1624				}
  1625				else
  1626	      ######    	    PerlIO_printf(Perl_debug_log, "(NULL)");
  1627	      ######    	break;
  1628			    case OP_PADSV:
  1629			    case OP_PADAV:
  1630			    case OP_PADHV:
  1631				{
  1632				/* print the lexical's name */
  1633	      ######    	CV *cv = deb_curcv(cxstack_ix);
  1634	      ######    	SV *sv;
  1635	      ######            if (cv) {
  1636	      ######                AV * const padlist = CvPADLIST(cv);
  1637	      ######                AV * const comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
  1638	      ######                sv = *av_fetch(comppad, o->op_targ, FALSE);
  1639			        } else
  1640	      ######                sv = Nullsv;
  1641	      ######            if (sv)
  1642	      ######               PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
  1643			        else
  1644	      ######               PerlIO_printf(Perl_debug_log, "[%"UVuf"]", (UV)o->op_targ);
  1645				}
  1646			        break;
  1647			    default:
  1648	          12    	break;
  1649			    }
  1650	          12        PerlIO_printf(Perl_debug_log, "\n");
  1651	          12        return 0;
  1652			}
  1653			
  1654			STATIC CV*
  1655			S_deb_curcv(pTHX_ I32 ix)
  1656	      ######    {
  1657	      ######        const PERL_CONTEXT *cx = &cxstack[ix];
  1658	      ######        if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT)
  1659	      ######            return cx->blk_sub.cv;
  1660	      ######        else if (CxTYPE(cx) == CXt_EVAL && !CxTRYBLOCK(cx))
  1661	      ######            return PL_compcv;
  1662	      ######        else if (ix == 0 && PL_curstackinfo->si_type == PERLSI_MAIN)
  1663	      ######            return PL_main_cv;
  1664	      ######        else if (ix <= 0)
  1665	      ######            return Nullcv;
  1666			    else
  1667	      ######            return deb_curcv(ix - 1);
  1668			}
  1669			
  1670			void
  1671			Perl_watch(pTHX_ char **addr)
  1672	      ######    {
  1673	      ######        PL_watchaddr = addr;
  1674	      ######        PL_watchok = *addr;
  1675	      ######        PerlIO_printf(Perl_debug_log, "WATCHING, %"UVxf" is currently %"UVxf"\n",
  1676				PTR2UV(PL_watchaddr), PTR2UV(PL_watchok));
  1677			}
  1678			
  1679			STATIC void
  1680			S_debprof(pTHX_ const OP *o)
  1681	      ######    {
  1682	      ######        if (CopSTASH_eq(PL_curcop, PL_debstash) && !DEBUG_J_TEST_)
  1683	      ######    	return;
  1684	      ######        if (!PL_profiledata)
  1685	      ######    	Newz(000, PL_profiledata, MAXO, U32);
  1686	      ######        ++PL_profiledata[o->op_type];
  1687			}
  1688			
  1689			void
  1690			Perl_debprofdump(pTHX)
  1691	      ######    {
  1692	      ######        unsigned i;
  1693	      ######        if (!PL_profiledata)
  1694	      ######    	return;
  1695	      ######        for (i = 0; i < MAXO; i++) {
  1696	      ######    	if (PL_profiledata[i])
  1697	      ######    	    PerlIO_printf(Perl_debug_log,
  1698						  "%5lu %s\n", (unsigned long)PL_profiledata[i],
  1699			                                       PL_op_name[i]);
  1700			    }
  1701			}
  1702			
  1703			/*
  1704			 * Local variables:
  1705			 * c-indentation-style: bsd
  1706			 * c-basic-offset: 4
  1707			 * indent-tabs-mode: t
  1708			 * End:
  1709			 *
  1710			 * ex: set ts=8 sts=4 sw=4 noet:
  1711			 */
