/* dump.c
*
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
+ * 2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
void
Perl_dump_vindent(pTHX_ I32 level, PerlIO *file, const char* pat, va_list *args)
{
+ dVAR;
PerlIO_printf(file, "%*s", (int)(level*PL_dumpindent), "");
PerlIO_vprintf(file, pat, *args);
}
void
Perl_dump_all(pTHX)
{
+ dVAR;
PerlIO_setlinebuf(Perl_debug_log);
if (PL_main_root)
op_dump(PL_main_root);
void
Perl_dump_packsubs(pTHX_ const HV *stash)
{
+ dVAR;
I32 i;
if (!HvARRAY(stash))
void
Perl_dump_eval(pTHX)
{
+ dVAR;
op_dump(PL_eval_root);
}
break;
}
switch (*pv) {
- case '\t': sv_catpvn(dsv, "\\t", 2); break;
- case '\n': sv_catpvn(dsv, "\\n", 2); break;
- case '\r': sv_catpvn(dsv, "\\r", 2); break;
- case '\f': sv_catpvn(dsv, "\\f", 2); break;
- case '"': sv_catpvn(dsv, "\\\"", 2); break;
- case '\\': sv_catpvn(dsv, "\\\\", 2); break;
+ case '\t': sv_catpvs(dsv, "\\t"); break;
+ case '\n': sv_catpvs(dsv, "\\n"); break;
+ case '\r': sv_catpvs(dsv, "\\r"); break;
+ case '\f': sv_catpvs(dsv, "\\f"); break;
+ case '"': sv_catpvs(dsv, "\\\""); break;
+ case '\\': sv_catpvs(dsv, "\\\\"); break;
default:
if (isPRINT(*pv))
sv_catpvn(dsv, pv, 1);
Perl_sv_catpvf(aTHX_ dsv, "\\%o", (U8)*pv);
}
}
- sv_catpvn(dsv, "\"", 1);
+ sv_catpvs(dsv, "\"");
if (truncated)
- sv_catpvn(dsv, "...", 3);
+ sv_catpvs(dsv, "...");
if (nul_terminated)
- sv_catpvn(dsv, "\\0", 2);
+ sv_catpvs(dsv, "\\0");
return SvPVX(dsv);
}
if (!SvPVX_const(sv))
sv_catpv(t, "(null)");
else {
- SV *tmp = newSVpvn("", 0);
+ SV *tmp = newSVpvs("");
sv_catpv(t, "(");
if (SvOOK(sv))
Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX_const(sv)-SvIVX(sv), SvIVX(sv), 0, 127));
op_dump(pm->op_pmreplroot);
}
if (pm->op_pmflags || (PM_GETRE(pm) && PM_GETRE(pm)->check_substr)) {
- SV *tmpsv = newSVpvn("", 0);
+ SV *tmpsv = newSVpvs("");
if (pm->op_pmdynflags & PMdf_USED)
sv_catpv(tmpsv, ",USED");
if (pm->op_pmdynflags & PMdf_TAINTED)
Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next);
#endif
if (o->op_flags) {
- SV *tmpsv = newSVpvn("", 0);
+ SV *tmpsv = newSVpvs("");
switch (o->op_flags & OPf_WANT) {
case OPf_WANT_VOID:
sv_catpv(tmpsv, ",VOID");
SvREFCNT_dec(tmpsv);
}
if (o->op_private) {
- SV *tmpsv = newSVpvn("", 0);
+ SV *tmpsv = newSVpvs("");
if (PL_opargs[o->op_type] & OA_TARGLEX) {
if (o->op_private & OPpTARGET_MY)
sv_catpv(tmpsv, ",TARGET_MY");
Perl_dump_indent(aTHX_ level, file, " MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr));
if (mg->mg_len >= 0) {
if (mg->mg_type != PERL_MAGIC_utf8) {
- SV *sv = newSVpvn("", 0);
+ SV *sv = newSVpvs("");
PerlIO_printf(file, " %s", pv_display(sv, mg->mg_ptr, mg->mg_len, 0, pvlim));
SvREFCNT_dec(sv);
}
void
Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
{
+ dVAR;
SV *d;
const char *s;
U32 flags;
void
Perl_sv_dump(pTHX_ SV *sv)
{
+ dVAR;
do_sv_dump(0, Perl_debug_log, sv, 0, 0, 0, 0);
}
int
Perl_runops_debug(pTHX)
{
+ dVAR;
if (!PL_op) {
if (ckWARN_d(WARN_DEBUGGING))
Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), "NULL OP IN RUN");
I32
Perl_debop(pTHX_ const OP *o)
{
+ dVAR;
if (CopSTASH_eq(PL_curcop, PL_debstash) && !DEBUG_J_TEST_)
return 0;
STATIC CV*
S_deb_curcv(pTHX_ I32 ix)
{
+ dVAR;
const PERL_CONTEXT *cx = &cxstack[ix];
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT)
return cx->blk_sub.cv;
void
Perl_watch(pTHX_ char **addr)
{
+ dVAR;
PL_watchaddr = addr;
PL_watchok = *addr;
PerlIO_printf(Perl_debug_log, "WATCHING, %"UVxf" is currently %"UVxf"\n",
STATIC void
S_debprof(pTHX_ const OP *o)
{
+ dVAR;
if (CopSTASH_eq(PL_curcop, PL_debstash) && !DEBUG_J_TEST_)
return;
if (!PL_profiledata)
void
Perl_debprofdump(pTHX)
{
+ dVAR;
unsigned i;
if (!PL_profiledata)
return;