3 * Copyright (c) 1991-2001, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * "'You have talked long in your sleep, Frodo,' said Gandalf gently, 'and
12 * it has not been hard for me to read your mind and memory.'"
16 #define PERL_IN_DUMP_C
21 Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...)
25 dump_vindent(level, file, pat, &args);
30 Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args)
32 PerlIO_printf(file, "%*s", (int)(level*PL_dumpindent), "");
33 PerlIO_vprintf(file, pat, *args);
39 PerlIO_setlinebuf(Perl_debug_log);
41 op_dump(PL_main_root);
42 dump_packsubs(PL_defstash);
46 Perl_dump_packsubs(pTHX_ HV *stash)
53 for (i = 0; i <= (I32) HvMAX(stash); i++) {
54 for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
55 GV *gv = (GV*)HeVAL(entry);
57 if (SvTYPE(gv) != SVt_PVGV || !GvGP(gv))
63 if (HeKEY(entry)[HeKLEN(entry)-1] == ':' &&
64 (hv = GvHV(gv)) && HvNAME(hv) && hv != PL_defstash)
65 dump_packsubs(hv); /* nested package */
71 Perl_dump_sub(pTHX_ GV *gv)
73 SV *sv = sv_newmortal();
75 gv_fullname3(sv, gv, Nullch);
76 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX(sv));
78 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%lx %d)\n",
79 (long)CvXSUB(GvCV(gv)),
80 (int)CvXSUBANY(GvCV(gv)).any_i32);
81 else if (CvROOT(GvCV(gv)))
82 op_dump(CvROOT(GvCV(gv)));
84 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "<undef>\n");
88 Perl_dump_form(pTHX_ GV *gv)
90 SV *sv = sv_newmortal();
92 gv_fullname3(sv, gv, Nullch);
93 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nFORMAT %s = ", SvPVX(sv));
94 if (CvROOT(GvFORM(gv)))
95 op_dump(CvROOT(GvFORM(gv)));
97 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "<undef>\n");
103 op_dump(PL_eval_root);
107 Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
110 int nul_terminated = len > cur && pv[cur] == '\0';
112 sv_setpvn(sv, "\"", 1);
113 for (; cur--; pv++) {
114 if (pvlim && SvCUR(sv) >= pvlim) {
120 case '\t': sv_catpvn(sv, "\\t", 2); break;
121 case '\n': sv_catpvn(sv, "\\n", 2); break;
122 case '\r': sv_catpvn(sv, "\\r", 2); break;
123 case '\f': sv_catpvn(sv, "\\f", 2); break;
124 case '"': sv_catpvn(sv, "\\\"", 2); break;
125 case '\\': sv_catpvn(sv, "\\\\", 2); break;
126 default: sv_catpvn(sv, pv, 1); break;
130 if (cur && isDIGIT(*(pv+1)))
131 Perl_sv_catpvf(aTHX_ sv, "\\%03o", (U8)*pv);
133 Perl_sv_catpvf(aTHX_ sv, "\\%o", (U8)*pv);
136 sv_catpvn(sv, "\"", 1);
138 sv_catpvn(sv, "...", 3);
140 sv_catpvn(sv, "\\0", 2);
146 Perl_sv_peek(pTHX_ SV *sv)
148 SV *t = sv_newmortal();
158 else if (sv == (SV*)0x55555555 || SvTYPE(sv) == 'U') {
162 else if (sv == &PL_sv_undef || sv == &PL_sv_no || sv == &PL_sv_yes) {
163 if (sv == &PL_sv_undef) {
164 sv_catpv(t, "SV_UNDEF");
165 if (!(SvFLAGS(sv) & (SVf_OK|SVf_OOK|SVs_OBJECT|
166 SVs_GMG|SVs_SMG|SVs_RMG)) &&
170 else if (sv == &PL_sv_no) {
171 sv_catpv(t, "SV_NO");
172 if (!(SvFLAGS(sv) & (SVf_ROK|SVf_OOK|SVs_OBJECT|
173 SVs_GMG|SVs_SMG|SVs_RMG)) &&
174 !(~SvFLAGS(sv) & (SVf_POK|SVf_NOK|SVf_READONLY|
181 sv_catpv(t, "SV_YES");
182 if (!(SvFLAGS(sv) & (SVf_ROK|SVf_OOK|SVs_OBJECT|
183 SVs_GMG|SVs_SMG|SVs_RMG)) &&
184 !(~SvFLAGS(sv) & (SVf_POK|SVf_NOK|SVf_READONLY|
187 SvPVX(sv) && *SvPVX(sv) == '1' &&
193 else if (SvREFCNT(sv) == 0) {
197 else if (DEBUG_R_TEST && SvREFCNT(sv) > 1) {
198 Perl_sv_catpvf(aTHX_ t, "<%"UVuf">", (UV)SvREFCNT(sv));
204 if (SvCUR(t) + unref > 10) {
205 SvCUR(t) = unref + 3;
213 switch (SvTYPE(sv)) {
215 sv_catpv(t, "FREED");
219 sv_catpv(t, "UNDEF");
253 Perl_sv_catpvf(aTHX_ t, "CV(%s)", GvNAME(CvGV(sv)));
273 sv_catpv(t, "(null)");
275 SV *tmp = newSVpvn("", 0);
278 Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, 127));
279 Perl_sv_catpvf(aTHX_ t, "%s)", pv_display(tmp, SvPVX(sv), SvCUR(sv), SvLEN(sv), 127));
281 Perl_sv_catpvf(aTHX_ t, " [UTF8]");
285 else if (SvNOKp(sv)) {
286 STORE_NUMERIC_LOCAL_SET_STANDARD();
287 Perl_sv_catpvf(aTHX_ t, "(%g)",SvNVX(sv));
288 RESTORE_NUMERIC_LOCAL();
290 else if (SvIOKp(sv)) {
292 Perl_sv_catpvf(aTHX_ t, "(%"UVuf")", (UV)SvUVX(sv));
294 Perl_sv_catpvf(aTHX_ t, "(%"IVdf")", (IV)SvIVX(sv));
308 Perl_do_pmop_dump(pTHX_ I32 level, PerlIO *file, PMOP *pm)
313 Perl_dump_indent(aTHX_ level, file, "{}\n");
316 Perl_dump_indent(aTHX_ level, file, "{\n");
318 if (pm->op_pmflags & PMf_ONCE)
323 Perl_dump_indent(aTHX_ level, file, "PMf_PRE %c%s%c%s\n",
324 ch, pm->op_pmregexp->precomp, ch,
325 (pm->op_private & OPpRUNTIME) ? " (RUNTIME)" : "");
327 Perl_dump_indent(aTHX_ level, file, "PMf_PRE (RUNTIME)\n");
328 if (pm->op_type != OP_PUSHRE && pm->op_pmreplroot) {
329 Perl_dump_indent(aTHX_ level, file, "PMf_REPL = ");
330 op_dump(pm->op_pmreplroot);
332 if (pm->op_pmflags || (pm->op_pmregexp && pm->op_pmregexp->check_substr)) {
333 SV *tmpsv = newSVpvn("", 0);
334 if (pm->op_pmdynflags & PMdf_USED)
335 sv_catpv(tmpsv, ",USED");
336 if (pm->op_pmdynflags & PMdf_TAINTED)
337 sv_catpv(tmpsv, ",TAINTED");
338 if (pm->op_pmflags & PMf_ONCE)
339 sv_catpv(tmpsv, ",ONCE");
340 if (pm->op_pmregexp && pm->op_pmregexp->check_substr
341 && !(pm->op_pmregexp->reganch & ROPT_NOSCAN))
342 sv_catpv(tmpsv, ",SCANFIRST");
343 if (pm->op_pmregexp && pm->op_pmregexp->check_substr
344 && pm->op_pmregexp->reganch & ROPT_CHECK_ALL)
345 sv_catpv(tmpsv, ",ALL");
346 if (pm->op_pmflags & PMf_SKIPWHITE)
347 sv_catpv(tmpsv, ",SKIPWHITE");
348 if (pm->op_pmflags & PMf_CONST)
349 sv_catpv(tmpsv, ",CONST");
350 if (pm->op_pmflags & PMf_KEEP)
351 sv_catpv(tmpsv, ",KEEP");
352 if (pm->op_pmflags & PMf_GLOBAL)
353 sv_catpv(tmpsv, ",GLOBAL");
354 if (pm->op_pmflags & PMf_CONTINUE)
355 sv_catpv(tmpsv, ",CONTINUE");
356 if (pm->op_pmflags & PMf_RETAINT)
357 sv_catpv(tmpsv, ",RETAINT");
358 if (pm->op_pmflags & PMf_EVAL)
359 sv_catpv(tmpsv, ",EVAL");
360 Perl_dump_indent(aTHX_ level, file, "PMFLAGS = (%s)\n", SvCUR(tmpsv) ? SvPVX(tmpsv) + 1 : "");
364 Perl_dump_indent(aTHX_ level-1, file, "}\n");
368 Perl_pmop_dump(pTHX_ PMOP *pm)
370 do_pmop_dump(0, Perl_debug_log, pm);
374 Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
376 Perl_dump_indent(aTHX_ level, file, "{\n");
379 PerlIO_printf(file, "%-4d", o->op_seq);
381 PerlIO_printf(file, " ");
383 "%*sTYPE = %s ===> ",
384 (int)(PL_dumpindent*level-4), "", PL_op_name[o->op_type]);
387 PerlIO_printf(file, "%d\n", o->op_next->op_seq);
389 PerlIO_printf(file, "(%d)\n", o->op_next->op_seq);
392 PerlIO_printf(file, "DONE\n");
394 if (o->op_type == OP_NULL)
395 Perl_dump_indent(aTHX_ level, file, " (was %s)\n", PL_op_name[o->op_targ]);
397 Perl_dump_indent(aTHX_ level, file, "TARG = %ld\n", (long)o->op_targ);
400 Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next);
403 SV *tmpsv = newSVpvn("", 0);
404 switch (o->op_flags & OPf_WANT) {
406 sv_catpv(tmpsv, ",VOID");
408 case OPf_WANT_SCALAR:
409 sv_catpv(tmpsv, ",SCALAR");
412 sv_catpv(tmpsv, ",LIST");
415 sv_catpv(tmpsv, ",UNKNOWN");
418 if (o->op_flags & OPf_KIDS)
419 sv_catpv(tmpsv, ",KIDS");
420 if (o->op_flags & OPf_PARENS)
421 sv_catpv(tmpsv, ",PARENS");
422 if (o->op_flags & OPf_STACKED)
423 sv_catpv(tmpsv, ",STACKED");
424 if (o->op_flags & OPf_REF)
425 sv_catpv(tmpsv, ",REF");
426 if (o->op_flags & OPf_MOD)
427 sv_catpv(tmpsv, ",MOD");
428 if (o->op_flags & OPf_SPECIAL)
429 sv_catpv(tmpsv, ",SPECIAL");
430 Perl_dump_indent(aTHX_ level, file, "FLAGS = (%s)\n", SvCUR(tmpsv) ? SvPVX(tmpsv) + 1 : "");
434 SV *tmpsv = newSVpvn("", 0);
435 if (PL_opargs[o->op_type] & OA_TARGLEX) {
436 if (o->op_private & OPpTARGET_MY)
437 sv_catpv(tmpsv, ",TARGET_MY");
439 else if (o->op_type == OP_LEAVESUB ||
440 o->op_type == OP_LEAVE ||
441 o->op_type == OP_LEAVESUBLV ||
442 o->op_type == OP_LEAVEWRITE) {
443 if (o->op_private & OPpREFCOUNTED)
444 sv_catpv(tmpsv, ",REFCOUNTED");
446 else if (o->op_type == OP_AASSIGN) {
447 if (o->op_private & OPpASSIGN_COMMON)
448 sv_catpv(tmpsv, ",COMMON");
449 if (o->op_private & OPpASSIGN_HASH)
450 sv_catpv(tmpsv, ",HASH");
452 else if (o->op_type == OP_SASSIGN) {
453 if (o->op_private & OPpASSIGN_BACKWARDS)
454 sv_catpv(tmpsv, ",BACKWARDS");
456 else if (o->op_type == OP_TRANS) {
457 if (o->op_private & OPpTRANS_SQUASH)
458 sv_catpv(tmpsv, ",SQUASH");
459 if (o->op_private & OPpTRANS_DELETE)
460 sv_catpv(tmpsv, ",DELETE");
461 if (o->op_private & OPpTRANS_COMPLEMENT)
462 sv_catpv(tmpsv, ",COMPLEMENT");
463 if (o->op_private & OPpTRANS_IDENTICAL)
464 sv_catpv(tmpsv, ",IDENTICAL");
465 if (o->op_private & OPpTRANS_GROWS)
466 sv_catpv(tmpsv, ",GROWS");
468 else if (o->op_type == OP_REPEAT) {
469 if (o->op_private & OPpREPEAT_DOLIST)
470 sv_catpv(tmpsv, ",DOLIST");
472 else if (o->op_type == OP_ENTERSUB ||
473 o->op_type == OP_RV2SV ||
474 o->op_type == OP_GVSV ||
475 o->op_type == OP_RV2AV ||
476 o->op_type == OP_RV2HV ||
477 o->op_type == OP_RV2GV ||
478 o->op_type == OP_AELEM ||
479 o->op_type == OP_HELEM )
481 if (o->op_type == OP_ENTERSUB) {
482 if (o->op_private & OPpENTERSUB_AMPER)
483 sv_catpv(tmpsv, ",AMPER");
484 if (o->op_private & OPpENTERSUB_DB)
485 sv_catpv(tmpsv, ",DB");
486 if (o->op_private & OPpENTERSUB_HASTARG)
487 sv_catpv(tmpsv, ",HASTARG");
488 if (o->op_private & OPpENTERSUB_NOPAREN)
489 sv_catpv(tmpsv, ",NOPAREN");
490 if (o->op_private & OPpENTERSUB_INARGS)
491 sv_catpv(tmpsv, ",INARGS");
494 switch (o->op_private & OPpDEREF) {
496 sv_catpv(tmpsv, ",SV");
499 sv_catpv(tmpsv, ",AV");
502 sv_catpv(tmpsv, ",HV");
505 if (o->op_private & OPpMAYBE_LVSUB)
506 sv_catpv(tmpsv, ",MAYBE_LVSUB");
508 if (o->op_type == OP_AELEM || o->op_type == OP_HELEM) {
509 if (o->op_private & OPpLVAL_DEFER)
510 sv_catpv(tmpsv, ",LVAL_DEFER");
513 if (o->op_private & HINT_STRICT_REFS)
514 sv_catpv(tmpsv, ",STRICT_REFS");
515 if (o->op_private & OPpOUR_INTRO)
516 sv_catpv(tmpsv, ",OUR_INTRO");
519 else if (o->op_type == OP_CONST) {
520 if (o->op_private & OPpCONST_BARE)
521 sv_catpv(tmpsv, ",BARE");
522 if (o->op_private & OPpCONST_STRICT)
523 sv_catpv(tmpsv, ",STRICT");
524 if (o->op_private & OPpCONST_ARYBASE)
525 sv_catpv(tmpsv, ",ARYBASE");
526 if (o->op_private & OPpCONST_WARNING)
527 sv_catpv(tmpsv, ",WARNING");
528 if (o->op_private & OPpCONST_ENTERED)
529 sv_catpv(tmpsv, ",ENTERED");
531 else if (o->op_type == OP_FLIP) {
532 if (o->op_private & OPpFLIP_LINENUM)
533 sv_catpv(tmpsv, ",LINENUM");
535 else if (o->op_type == OP_FLOP) {
536 if (o->op_private & OPpFLIP_LINENUM)
537 sv_catpv(tmpsv, ",LINENUM");
538 } else if (o->op_type == OP_RV2CV) {
539 if (o->op_private & OPpLVAL_INTRO)
540 sv_catpv(tmpsv, ",INTRO");
542 else if (o->op_type == OP_GV) {
543 if (o->op_private & OPpEARLY_CV)
544 sv_catpv(tmpsv, ",EARLY_CV");
546 else if (o->op_type == OP_LIST) {
547 if (o->op_private & OPpLIST_GUESSED)
548 sv_catpv(tmpsv, ",GUESSED");
550 else if (o->op_type == OP_DELETE) {
551 if (o->op_private & OPpSLICE)
552 sv_catpv(tmpsv, ",SLICE");
554 else if (o->op_type == OP_EXISTS) {
555 if (o->op_private & OPpEXISTS_SUB)
556 sv_catpv(tmpsv, ",EXISTS_SUB");
558 else if (o->op_type == OP_SORT) {
559 if (o->op_private & OPpSORT_NUMERIC)
560 sv_catpv(tmpsv, ",NUMERIC");
561 if (o->op_private & OPpSORT_INTEGER)
562 sv_catpv(tmpsv, ",INTEGER");
563 if (o->op_private & OPpSORT_REVERSE)
564 sv_catpv(tmpsv, ",REVERSE");
566 else if (o->op_type == OP_THREADSV) {
567 if (o->op_private & OPpDONE_SVREF)
568 sv_catpv(tmpsv, ",SVREF");
570 else if (o->op_type == OP_OPEN || o->op_type == OP_BACKTICK) {
571 if (o->op_private & OPpOPEN_IN_RAW)
572 sv_catpv(tmpsv, ",IN_RAW");
573 if (o->op_private & OPpOPEN_IN_CRLF)
574 sv_catpv(tmpsv, ",IN_CRLF");
575 if (o->op_private & OPpOPEN_OUT_RAW)
576 sv_catpv(tmpsv, ",OUT_RAW");
577 if (o->op_private & OPpOPEN_OUT_CRLF)
578 sv_catpv(tmpsv, ",OUT_CRLF");
580 else if (o->op_type == OP_EXIT) {
581 if (o->op_private & OPpEXIT_VMSISH)
582 sv_catpv(tmpsv, ",EXIST_VMSISH");
584 if (o->op_flags & OPf_MOD && o->op_private & OPpLVAL_INTRO)
585 sv_catpv(tmpsv, ",INTRO");
587 Perl_dump_indent(aTHX_ level, file, "PRIVATE = (%s)\n", SvPVX(tmpsv) + 1);
591 switch (o->op_type) {
596 Perl_dump_indent(aTHX_ level, file, "PADIX = %d\n", cPADOPo->op_padix);
599 SV *tmpsv = NEWSV(0,0);
603 gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, Nullch);
604 Perl_dump_indent(aTHX_ level, file, "GV = %s\n", SvPV(tmpsv, n_a));
608 Perl_dump_indent(aTHX_ level, file, "GV = NULL\n");
612 case OP_METHOD_NAMED:
613 Perl_dump_indent(aTHX_ level, file, "SV = %s\n", SvPEEK(cSVOPo->op_sv));
619 Perl_dump_indent(aTHX_ level, file, "LINE = %d\n",CopLINE(cCOPo));
620 if (CopSTASHPV(cCOPo))
621 Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
623 if (cCOPo->cop_label)
624 Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",
628 Perl_dump_indent(aTHX_ level, file, "REDO ===> ");
629 if (cLOOPo->op_redoop)
630 PerlIO_printf(file, "%d\n", cLOOPo->op_redoop->op_seq);
632 PerlIO_printf(file, "DONE\n");
633 Perl_dump_indent(aTHX_ level, file, "NEXT ===> ");
634 if (cLOOPo->op_nextop)
635 PerlIO_printf(file, "%d\n", cLOOPo->op_nextop->op_seq);
637 PerlIO_printf(file, "DONE\n");
638 Perl_dump_indent(aTHX_ level, file, "LAST ===> ");
639 if (cLOOPo->op_lastop)
640 PerlIO_printf(file, "%d\n", cLOOPo->op_lastop->op_seq);
642 PerlIO_printf(file, "DONE\n");
650 Perl_dump_indent(aTHX_ level, file, "OTHER ===> ");
651 if (cLOGOPo->op_other)
652 PerlIO_printf(file, "%d\n", cLOGOPo->op_other->op_seq);
654 PerlIO_printf(file, "DONE\n");
660 do_pmop_dump(level, file, cPMOPo);
668 if (o->op_private & OPpREFCOUNTED)
669 Perl_dump_indent(aTHX_ level, file, "REFCNT = %"UVuf"\n", (UV)o->op_targ);
674 if (o->op_flags & OPf_KIDS) {
676 for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling)
677 do_op_dump(level, file, kid);
679 Perl_dump_indent(aTHX_ level-1, file, "}\n");
683 Perl_op_dump(pTHX_ OP *o)
685 do_op_dump(0, Perl_debug_log, o);
689 Perl_gv_dump(pTHX_ GV *gv)
694 PerlIO_printf(Perl_debug_log, "{}\n");
698 PerlIO_printf(Perl_debug_log, "{\n");
699 gv_fullname3(sv, gv, Nullch);
700 Perl_dump_indent(aTHX_ 1, Perl_debug_log, "GV_NAME = %s", SvPVX(sv));
701 if (gv != GvEGV(gv)) {
702 gv_efullname3(sv, GvEGV(gv), Nullch);
703 Perl_dump_indent(aTHX_ 1, Perl_debug_log, "-> %s", SvPVX(sv));
705 PerlIO_putc(Perl_debug_log, '\n');
706 Perl_dump_indent(aTHX_ 0, Perl_debug_log, "}\n");
710 /* map magic types to the symbolic name
711 * (with the PERL_MAGIC_ prefixed stripped)
714 static struct { char type; char *name; } magic_names[] = {
715 { PERL_MAGIC_sv, "sv(\\0)" },
716 { PERL_MAGIC_arylen, "arylen(#)" },
717 { PERL_MAGIC_glob, "glob(*)" },
718 { PERL_MAGIC_pos, "pos(.)" },
719 { PERL_MAGIC_backref, "backref(<)" },
720 { PERL_MAGIC_overload, "overload(A)" },
721 { PERL_MAGIC_bm, "bm(B)" },
722 { PERL_MAGIC_regdata, "regdata(D)" },
723 { PERL_MAGIC_env, "env(E)" },
724 { PERL_MAGIC_isa, "isa(I)" },
725 { PERL_MAGIC_dbfile, "dbfile(L)" },
726 { PERL_MAGIC_tied, "tied(P)" },
727 { PERL_MAGIC_sig, "sig(S)" },
728 { PERL_MAGIC_uvar, "uvar(U)" },
729 { PERL_MAGIC_overload_elem, "overload_elem(a)" },
730 { PERL_MAGIC_overload_table, "overload_table(c)" },
731 { PERL_MAGIC_regdatum, "regdatum(d)" },
732 { PERL_MAGIC_envelem, "envelem(e)" },
733 { PERL_MAGIC_fm, "fm(f)" },
734 { PERL_MAGIC_regex_global, "regex_global(g)" },
735 { PERL_MAGIC_isaelem, "isaelem(i)" },
736 { PERL_MAGIC_nkeys, "nkeys(k)" },
737 { PERL_MAGIC_dbline, "dbline(l)" },
738 { PERL_MAGIC_mutex, "mutex(m)" },
739 { PERL_MAGIC_collxfrm, "collxfrm(o)" },
740 { PERL_MAGIC_tiedelem, "tiedelem(p)" },
741 { PERL_MAGIC_tiedscalar, "tiedscalar(q)" },
742 { PERL_MAGIC_qr, "qr(r)" },
743 { PERL_MAGIC_sigelem, "sigelem(s)" },
744 { PERL_MAGIC_taint, "taint(t)" },
745 { PERL_MAGIC_vec, "vec(v)" },
746 { PERL_MAGIC_substr, "substr(x)" },
747 { PERL_MAGIC_defelem, "defelem(y)" },
748 { PERL_MAGIC_ext, "ext(~)" },
749 /* this null string terminates the list */
754 Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
756 for (; mg; mg = mg->mg_moremagic) {
757 Perl_dump_indent(aTHX_ level, file,
758 " MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
759 if (mg->mg_virtual) {
760 MGVTBL *v = mg->mg_virtual;
762 if (v == &PL_vtbl_sv) s = "sv";
763 else if (v == &PL_vtbl_env) s = "env";
764 else if (v == &PL_vtbl_envelem) s = "envelem";
765 else if (v == &PL_vtbl_sig) s = "sig";
766 else if (v == &PL_vtbl_sigelem) s = "sigelem";
767 else if (v == &PL_vtbl_pack) s = "pack";
768 else if (v == &PL_vtbl_packelem) s = "packelem";
769 else if (v == &PL_vtbl_dbline) s = "dbline";
770 else if (v == &PL_vtbl_isa) s = "isa";
771 else if (v == &PL_vtbl_arylen) s = "arylen";
772 else if (v == &PL_vtbl_glob) s = "glob";
773 else if (v == &PL_vtbl_mglob) s = "mglob";
774 else if (v == &PL_vtbl_nkeys) s = "nkeys";
775 else if (v == &PL_vtbl_taint) s = "taint";
776 else if (v == &PL_vtbl_substr) s = "substr";
777 else if (v == &PL_vtbl_vec) s = "vec";
778 else if (v == &PL_vtbl_pos) s = "pos";
779 else if (v == &PL_vtbl_bm) s = "bm";
780 else if (v == &PL_vtbl_fm) s = "fm";
781 else if (v == &PL_vtbl_uvar) s = "uvar";
782 else if (v == &PL_vtbl_defelem) s = "defelem";
783 #ifdef USE_LOCALE_COLLATE
784 else if (v == &PL_vtbl_collxfrm) s = "collxfrm";
786 else if (v == &PL_vtbl_amagic) s = "amagic";
787 else if (v == &PL_vtbl_amagicelem) s = "amagicelem";
788 else if (v == &PL_vtbl_backref) s = "backref";
790 Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = &PL_vtbl_%s\n", s);
792 Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = 0x%"UVxf"\n", PTR2UV(v));
795 Perl_dump_indent(aTHX_ level, file, " MG_VIRTUAL = 0\n");
798 Perl_dump_indent(aTHX_ level, file, " MG_PRIVATE = %d\n", mg->mg_private);
803 for (n=0; magic_names[n].name; n++) {
804 if (mg->mg_type == magic_names[n].type) {
805 name = magic_names[n].name;
810 Perl_dump_indent(aTHX_ level, file,
811 " MG_TYPE = PERL_MAGIC_%s\n", name);
813 Perl_dump_indent(aTHX_ level, file,
814 " MG_TYPE = UNKNOWN(\\%o)\n", mg->mg_type);
818 Perl_dump_indent(aTHX_ level, file, " MG_FLAGS = 0x%02X\n", mg->mg_flags);
819 if (mg->mg_flags & MGf_TAINTEDDIR)
820 Perl_dump_indent(aTHX_ level, file, " TAINTEDDIR\n");
821 if (mg->mg_flags & MGf_REFCOUNTED)
822 Perl_dump_indent(aTHX_ level, file, " REFCOUNTED\n");
823 if (mg->mg_flags & MGf_GSKIP)
824 Perl_dump_indent(aTHX_ level, file, " GSKIP\n");
825 if (mg->mg_flags & MGf_MINMATCH)
826 Perl_dump_indent(aTHX_ level, file, " MINMATCH\n");
829 Perl_dump_indent(aTHX_ level, file, " MG_OBJ = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
830 if (mg->mg_flags & MGf_REFCOUNTED)
831 do_sv_dump(level+2, file, mg->mg_obj, nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
834 Perl_dump_indent(aTHX_ level, file, " MG_LEN = %ld\n", (long)mg->mg_len);
836 Perl_dump_indent(aTHX_ level, file, " MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr));
837 if (mg->mg_len >= 0) {
838 SV *sv = newSVpvn("", 0);
839 PerlIO_printf(file, " %s", pv_display(sv, mg->mg_ptr, mg->mg_len, 0, pvlim));
842 else if (mg->mg_len == HEf_SVKEY) {
843 PerlIO_puts(file, " => HEf_SVKEY\n");
844 do_sv_dump(level+2, file, (SV*)((mg)->mg_ptr), nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
848 PerlIO_puts(file, " ???? - please notify IZ");
849 PerlIO_putc(file, '\n');
855 Perl_magic_dump(pTHX_ MAGIC *mg)
857 do_magic_dump(0, Perl_debug_log, mg, 0, 0, 0, 0);
861 Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv)
863 Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
864 if (sv && HvNAME(sv))
865 PerlIO_printf(file, "\t\"%s\"\n", HvNAME(sv));
867 PerlIO_putc(file, '\n');
871 Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
873 Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
874 if (sv && GvNAME(sv))
875 PerlIO_printf(file, "\t\"%s\"\n", GvNAME(sv));
877 PerlIO_putc(file, '\n');
881 Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
883 Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
884 if (sv && GvNAME(sv)) {
885 PerlIO_printf(file, "\t\"");
886 if (GvSTASH(sv) && HvNAME(GvSTASH(sv)))
887 PerlIO_printf(file, "%s\" :: \"", HvNAME(GvSTASH(sv)));
888 PerlIO_printf(file, "%s\"\n", GvNAME(sv));
891 PerlIO_putc(file, '\n');
895 Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
904 Perl_dump_indent(aTHX_ level, file, "SV = 0\n");
911 d = Perl_newSVpvf(aTHX_
912 "(0x%"UVxf") at 0x%"UVxf"\n%*s REFCNT = %"IVdf"\n%*s FLAGS = (",
913 PTR2UV(SvANY(sv)), PTR2UV(sv),
914 (int)(PL_dumpindent*level), "", (IV)SvREFCNT(sv),
915 (int)(PL_dumpindent*level), "");
917 if (flags & SVs_PADBUSY) sv_catpv(d, "PADBUSY,");
918 if (flags & SVs_PADTMP) sv_catpv(d, "PADTMP,");
919 if (flags & SVs_PADMY) sv_catpv(d, "PADMY,");
920 if (flags & SVs_TEMP) sv_catpv(d, "TEMP,");
921 if (flags & SVs_OBJECT) sv_catpv(d, "OBJECT,");
922 if (flags & SVs_GMG) sv_catpv(d, "GMG,");
923 if (flags & SVs_SMG) sv_catpv(d, "SMG,");
924 if (flags & SVs_RMG) sv_catpv(d, "RMG,");
926 if (flags & SVf_IOK) sv_catpv(d, "IOK,");
927 if (flags & SVf_NOK) sv_catpv(d, "NOK,");
928 if (flags & SVf_POK) sv_catpv(d, "POK,");
929 if (flags & SVf_ROK) {
931 if (SvWEAKREF(sv)) sv_catpv(d, "WEAKREF,");
933 if (flags & SVf_OOK) sv_catpv(d, "OOK,");
934 if (flags & SVf_FAKE) sv_catpv(d, "FAKE,");
935 if (flags & SVf_READONLY) sv_catpv(d, "READONLY,");
937 if (flags & SVf_AMAGIC) sv_catpv(d, "OVERLOAD,");
938 if (flags & SVp_IOK) sv_catpv(d, "pIOK,");
939 if (flags & SVp_NOK) sv_catpv(d, "pNOK,");
940 if (flags & SVp_POK) sv_catpv(d, "pPOK,");
941 if (flags & SVp_SCREAM) sv_catpv(d, "SCREAM,");
946 if (CvANON(sv)) sv_catpv(d, "ANON,");
947 if (CvUNIQUE(sv)) sv_catpv(d, "UNIQUE,");
948 if (CvCLONE(sv)) sv_catpv(d, "CLONE,");
949 if (CvCLONED(sv)) sv_catpv(d, "CLONED,");
950 if (CvCONST(sv)) sv_catpv(d, "CONST,");
951 if (CvNODEBUG(sv)) sv_catpv(d, "NODEBUG,");
952 if (SvCOMPILED(sv)) sv_catpv(d, "COMPILED,");
953 if (CvLVALUE(sv)) sv_catpv(d, "LVALUE,");
954 if (CvMETHOD(sv)) sv_catpv(d, "METHOD,");
957 if (HvSHAREKEYS(sv)) sv_catpv(d, "SHAREKEYS,");
958 if (HvLAZYDEL(sv)) sv_catpv(d, "LAZYDEL,");
961 if (GvINTRO(sv)) sv_catpv(d, "INTRO,");
962 if (GvMULTI(sv)) sv_catpv(d, "MULTI,");
963 if (GvSHARED(sv)) sv_catpv(d, "SHARED,");
964 if (GvASSUMECV(sv)) sv_catpv(d, "ASSUMECV,");
965 if (GvIN_PAD(sv)) sv_catpv(d, "IN_PAD,");
966 if (GvIMPORTED(sv)) {
967 sv_catpv(d, "IMPORT");
968 if (GvIMPORTED(sv) == GVf_IMPORTED)
972 if (GvIMPORTED_SV(sv)) sv_catpv(d, " SV");
973 if (GvIMPORTED_AV(sv)) sv_catpv(d, " AV");
974 if (GvIMPORTED_HV(sv)) sv_catpv(d, " HV");
975 if (GvIMPORTED_CV(sv)) sv_catpv(d, " CV");
981 if (SvEVALED(sv)) sv_catpv(d, "EVALED,");
982 if (SvIsUV(sv)) sv_catpv(d, "IsUV,");
983 if (SvUTF8(sv)) sv_catpv(d, "UTF8");
986 if (SvTAIL(sv)) sv_catpv(d, "TAIL,");
987 if (SvVALID(sv)) sv_catpv(d, "VALID,");
991 if (*(SvEND(d) - 1) == ',')
992 SvPVX(d)[--SvCUR(d)] = '\0';
996 Perl_dump_indent(aTHX_ level, file, "SV = ");
999 PerlIO_printf(file, "NULL%s\n", s);
1003 PerlIO_printf(file, "IV%s\n", s);
1006 PerlIO_printf(file, "NV%s\n", s);
1009 PerlIO_printf(file, "RV%s\n", s);
1012 PerlIO_printf(file, "PV%s\n", s);
1015 PerlIO_printf(file, "PVIV%s\n", s);
1018 PerlIO_printf(file, "PVNV%s\n", s);
1021 PerlIO_printf(file, "PVBM%s\n", s);
1024 PerlIO_printf(file, "PVMG%s\n", s);
1027 PerlIO_printf(file, "PVLV%s\n", s);
1030 PerlIO_printf(file, "PVAV%s\n", s);
1033 PerlIO_printf(file, "PVHV%s\n", s);
1036 PerlIO_printf(file, "PVCV%s\n", s);
1039 PerlIO_printf(file, "PVGV%s\n", s);
1042 PerlIO_printf(file, "PVFM%s\n", s);
1045 PerlIO_printf(file, "PVIO%s\n", s);
1048 PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s);
1052 if (type >= SVt_PVIV || type == SVt_IV) {
1054 Perl_dump_indent(aTHX_ level, file, " UV = %"UVuf, (UV)SvUVX(sv));
1056 Perl_dump_indent(aTHX_ level, file, " IV = %"IVdf, (IV)SvIVX(sv));
1058 PerlIO_printf(file, " (OFFSET)");
1059 PerlIO_putc(file, '\n');
1061 if (type >= SVt_PVNV || type == SVt_NV) {
1062 STORE_NUMERIC_LOCAL_SET_STANDARD();
1063 /* %Vg doesn't work? --jhi */
1064 #ifdef USE_LONG_DOUBLE
1065 Perl_dump_indent(aTHX_ level, file, " NV = %.*" PERL_PRIgldbl "\n", LDBL_DIG, SvNVX(sv));
1067 Perl_dump_indent(aTHX_ level, file, " NV = %.*g\n", DBL_DIG, SvNVX(sv));
1069 RESTORE_NUMERIC_LOCAL();
1072 Perl_dump_indent(aTHX_ level, file, " RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv)));
1074 do_sv_dump(level+1, file, SvRV(sv), nest+1, maxnest, dumpops, pvlim);
1078 if (type < SVt_PV) {
1082 if (type <= SVt_PVLV) {
1084 Perl_dump_indent(aTHX_ level, file," PV = 0x%"UVxf" ", PTR2UV(SvPVX(sv)));
1086 PerlIO_printf(file, "( %s . ) ", pv_display(d, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, pvlim));
1087 PerlIO_printf(file, "%s\n", pv_display(d, SvPVX(sv), SvCUR(sv), SvLEN(sv), pvlim));
1088 Perl_dump_indent(aTHX_ level, file, " CUR = %"IVdf"\n", (IV)SvCUR(sv));
1089 Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n", (IV)SvLEN(sv));
1092 Perl_dump_indent(aTHX_ level, file, " PV = 0\n");
1094 if (type >= SVt_PVMG) {
1096 do_magic_dump(level, file, SvMAGIC(sv), nest, maxnest, dumpops, pvlim);
1098 do_hv_dump(level, file, " STASH", SvSTASH(sv));
1102 Perl_dump_indent(aTHX_ level, file, " TYPE = %c\n", LvTYPE(sv));
1103 Perl_dump_indent(aTHX_ level, file, " TARGOFF = %"IVdf"\n", (IV)LvTARGOFF(sv));
1104 Perl_dump_indent(aTHX_ level, file, " TARGLEN = %"IVdf"\n", (IV)LvTARGLEN(sv));
1105 Perl_dump_indent(aTHX_ level, file, " TARG = 0x%"UVxf"\n", PTR2UV(LvTARG(sv)));
1106 /* XXX level+1 ??? */
1107 do_sv_dump(level, file, LvTARG(sv), nest+1, maxnest, dumpops, pvlim);
1110 Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(AvARRAY(sv)));
1111 if (AvARRAY(sv) != AvALLOC(sv)) {
1112 PerlIO_printf(file, " (offset=%"IVdf")\n", (IV)(AvARRAY(sv) - AvALLOC(sv)));
1113 Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%"UVxf"\n", PTR2UV(AvALLOC(sv)));
1116 PerlIO_putc(file, '\n');
1117 Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)AvFILLp(sv));
1118 Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)AvMAX(sv));
1119 Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%"UVxf"\n", PTR2UV(AvARYLEN(sv)));
1120 flags = AvFLAGS(sv);
1122 if (flags & AVf_REAL) sv_catpv(d, ",REAL");
1123 if (flags & AVf_REIFY) sv_catpv(d, ",REIFY");
1124 if (flags & AVf_REUSED) sv_catpv(d, ",REUSED");
1125 Perl_dump_indent(aTHX_ level, file, " FLAGS = (%s)\n", SvCUR(d) ? SvPVX(d) + 1 : "");
1126 if (nest < maxnest && av_len((AV*)sv) >= 0) {
1128 for (count = 0; count <= av_len((AV*)sv) && count < maxnest; count++) {
1129 SV** elt = av_fetch((AV*)sv,count,0);
1131 Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %"IVdf"\n", (IV)count);
1133 do_sv_dump(level+1, file, *elt, nest+1, maxnest, dumpops, pvlim);
1138 Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
1139 if (HvARRAY(sv) && HvKEYS(sv)) {
1140 /* Show distribution of HEs in the ARRAY */
1142 #define FREQ_MAX (sizeof freq / sizeof freq[0] - 1)
1145 U32 pow2 = 2, keys = HvKEYS(sv);
1146 NV theoret, sum = 0;
1148 PerlIO_printf(file, " (");
1149 Zero(freq, FREQ_MAX + 1, int);
1150 for (i = 0; i <= HvMAX(sv); i++) {
1151 HE* h; int count = 0;
1152 for (h = HvARRAY(sv)[i]; h; h = HeNEXT(h))
1154 if (count > FREQ_MAX)
1160 for (i = 0; i <= max; i++) {
1162 PerlIO_printf(file, "%d%s:%d", i,
1163 (i == FREQ_MAX) ? "+" : "",
1166 PerlIO_printf(file, ", ");
1169 PerlIO_putc(file, ')');
1170 /* The "quality" of a hash is defined as the total number of
1171 comparisons needed to access every element once, relative
1172 to the expected number needed for a random hash.
1174 The total number of comparisons is equal to the sum of
1175 the squares of the number of entries in each backet.
1176 For a random hash of n keys into k backets, the expected
1181 for (i = max; i > 0; i--) { /* Precision: count down. */
1182 sum += freq[i] * i * i;
1184 while ((keys = keys >> 1))
1186 theoret = HvKEYS(sv);
1187 theoret += theoret * (theoret-1)/pow2;
1188 PerlIO_putc(file, '\n');
1189 Perl_dump_indent(aTHX_ level, file, " hash quality = %.1"NVff"%%", theoret/sum*100);
1191 PerlIO_putc(file, '\n');
1192 Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvKEYS(sv));
1193 Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)HvFILL(sv));
1194 Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)HvMAX(sv));
1195 Perl_dump_indent(aTHX_ level, file, " RITER = %"IVdf"\n", (IV)HvRITER(sv));
1196 Perl_dump_indent(aTHX_ level, file, " EITER = 0x%"UVxf"\n", PTR2UV(HvEITER(sv)));
1198 Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%"UVxf"\n", PTR2UV(HvPMROOT(sv)));
1200 Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", HvNAME(sv));
1201 if (nest < maxnest && !HvEITER(sv)) { /* Try to preserve iterator */
1204 int count = maxnest - nest;
1207 while ((he = hv_iternext(hv)) && count--) {
1211 U32 hash = HeHASH(he);
1213 key = hv_iterkey(he, &len);
1214 elt = hv_iterval(hv, he);
1215 Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%"UVxf"\n", pv_display(d, key, len, 0, pvlim), (UV)hash);
1216 do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
1218 hv_iterinit(hv); /* Return to status quo */
1223 Perl_dump_indent(aTHX_ level, file, " PROTOTYPE = \"%s\"\n", SvPV(sv,n_a));
1226 do_hv_dump(level, file, " COMP_STASH", CvSTASH(sv));
1228 Perl_dump_indent(aTHX_ level, file, " START = 0x%"UVxf" ===> %"IVdf"\n", PTR2UV(CvSTART(sv)), (IV)CvSTART(sv)->op_seq);
1229 Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%"UVxf"\n", PTR2UV(CvROOT(sv)));
1230 if (CvROOT(sv) && dumpops)
1231 do_op_dump(level+1, file, CvROOT(sv));
1232 Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
1233 Perl_dump_indent(aTHX_ level, file, " XSUBANY = %"IVdf"\n", (IV)CvXSUBANY(sv).any_i32);
1234 do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv));
1235 Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", CvFILE(sv));
1236 Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
1238 Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%"UVxf"\n", PTR2UV(CvMUTEXP(sv)));
1239 Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%"UVxf"\n", PTR2UV(CvOWNER(sv)));
1240 #endif /* USE_THREADS */
1241 Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)CvFLAGS(sv));
1242 if (type == SVt_PVFM)
1243 Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)FmLINES(sv));
1244 Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%"UVxf"\n", PTR2UV(CvPADLIST(sv)));
1245 if (nest < maxnest && CvPADLIST(sv)) {
1246 AV* padlist = CvPADLIST(sv);
1247 AV* pad_name = (AV*)*av_fetch(padlist, 0, FALSE);
1248 AV* pad = (AV*)*av_fetch(padlist, 1, FALSE);
1249 SV** pname = AvARRAY(pad_name);
1250 SV** ppad = AvARRAY(pad);
1253 for (ix = 1; ix <= AvFILL(pad_name); ix++) {
1254 if (SvPOK(pname[ix]))
1255 Perl_dump_indent(aTHX_ level,
1256 /* %5d below is enough whitespace. */
1258 "%5d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n",
1259 (int)ix, PTR2UV(ppad[ix]),
1260 SvFAKE(pname[ix]) ? "FAKE " : "",
1262 (IV)SvNVX(pname[ix]),
1263 (IV)SvIVX(pname[ix]));
1267 CV *outside = CvOUTSIDE(sv);
1268 Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%"UVxf" (%s)\n",
1271 : CvANON(outside) ? "ANON"
1272 : (outside == PL_main_cv) ? "MAIN"
1273 : CvUNIQUE(outside) ? "UNIQUE"
1274 : CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
1276 if (nest < maxnest && (CvCLONE(sv) || CvCLONED(sv)))
1277 do_sv_dump(level+1, file, (SV*)CvOUTSIDE(sv), nest+1, maxnest, dumpops, pvlim);
1280 Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", GvNAME(sv));
1281 Perl_dump_indent(aTHX_ level, file, " NAMELEN = %"IVdf"\n", (IV)GvNAMELEN(sv));
1282 do_hv_dump (level, file, " GvSTASH", GvSTASH(sv));
1283 Perl_dump_indent(aTHX_ level, file, " GP = 0x%"UVxf"\n", PTR2UV(GvGP(sv)));
1286 Perl_dump_indent(aTHX_ level, file, " SV = 0x%"UVxf"\n", PTR2UV(GvSV(sv)));
1287 Perl_dump_indent(aTHX_ level, file, " REFCNT = %"IVdf"\n", (IV)GvREFCNT(sv));
1288 Perl_dump_indent(aTHX_ level, file, " IO = 0x%"UVxf"\n", PTR2UV(GvIOp(sv)));
1289 Perl_dump_indent(aTHX_ level, file, " FORM = 0x%"UVxf" \n", PTR2UV(GvFORM(sv)));
1290 Perl_dump_indent(aTHX_ level, file, " AV = 0x%"UVxf"\n", PTR2UV(GvAV(sv)));
1291 Perl_dump_indent(aTHX_ level, file, " HV = 0x%"UVxf"\n", PTR2UV(GvHV(sv)));
1292 Perl_dump_indent(aTHX_ level, file, " CV = 0x%"UVxf"\n", PTR2UV(GvCV(sv)));
1293 Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%"UVxf"\n", (UV)GvCVGEN(sv));
1294 Perl_dump_indent(aTHX_ level, file, " GPFLAGS = 0x%"UVxf"\n", (UV)GvGPFLAGS(sv));
1295 Perl_dump_indent(aTHX_ level, file, " LINE = %"IVdf"\n", (IV)GvLINE(sv));
1296 Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", GvFILE(sv));
1297 Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)GvFLAGS(sv));
1298 do_gv_dump (level, file, " EGV", GvEGV(sv));
1301 Perl_dump_indent(aTHX_ level, file, " IFP = 0x%"UVxf"\n", PTR2UV(IoIFP(sv)));
1302 Perl_dump_indent(aTHX_ level, file, " OFP = 0x%"UVxf"\n", PTR2UV(IoOFP(sv)));
1303 Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%"UVxf"\n", PTR2UV(IoDIRP(sv)));
1304 Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)IoLINES(sv));
1305 Perl_dump_indent(aTHX_ level, file, " PAGE = %"IVdf"\n", (IV)IoPAGE(sv));
1306 Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %"IVdf"\n", (IV)IoPAGE_LEN(sv));
1307 Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %"IVdf"\n", (IV)IoLINES_LEFT(sv));
1309 Perl_dump_indent(aTHX_ level, file, " TOP_NAME = \"%s\"\n", IoTOP_NAME(sv));
1310 do_gv_dump (level, file, " TOP_GV", IoTOP_GV(sv));
1312 Perl_dump_indent(aTHX_ level, file, " FMT_NAME = \"%s\"\n", IoFMT_NAME(sv));
1313 do_gv_dump (level, file, " FMT_GV", IoFMT_GV(sv));
1314 if (IoBOTTOM_NAME(sv))
1315 Perl_dump_indent(aTHX_ level, file, " BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
1316 do_gv_dump (level, file, " BOTTOM_GV", IoBOTTOM_GV(sv));
1317 Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %"IVdf"\n", (IV)IoSUBPROCESS(sv));
1318 if (isPRINT(IoTYPE(sv)))
1319 Perl_dump_indent(aTHX_ level, file, " TYPE = '%c'\n", IoTYPE(sv));
1321 Perl_dump_indent(aTHX_ level, file, " TYPE = '\\%o'\n", IoTYPE(sv));
1322 Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv));
1329 Perl_sv_dump(pTHX_ SV *sv)
1331 do_sv_dump(0, Perl_debug_log, sv, 0, 0, 0, 0);