3 * Copyright (c) 1991-1997, 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 * "Didst thou think that the eyes of the White Tower were blind? Nay, I
12 * have seen more than thou knowest, Gray Fool." --Denethor
19 deb(const char *pat, ...)
25 GV* gv = curcop->cop_filegv;
28 PerlIO_printf(Perl_debug_log, "0x%lx (%s:%ld)\t",
30 SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
31 (long)curcop->cop_line);
33 PerlIO_printf(Perl_debug_log, "(%s:%ld)\t",
34 SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
35 (long)curcop->cop_line);
36 #endif /* USE_THREADS */
37 for (i=0; i<dlevel; i++)
38 PerlIO_printf(Perl_debug_log, "%c%c ",debname[i],debdelim[i]);
41 (void) PerlIO_vprintf(Perl_debug_log,pat,args);
43 #endif /* DEBUGGING */
51 Renew(debname, dlmax, char);
52 Renew(debdelim, dlmax, char);
53 #endif /* DEBUGGING */
61 PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
62 (unsigned long)curstack, (unsigned long)stack_base,
63 (long)*markstack_ptr, (long)(stack_sp-stack_base),
64 (long)(stack_max-stack_base));
65 PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
66 (unsigned long)mainstack, (unsigned long)AvARRAY(curstack),
67 (long)mainstack, (long)AvFILLp(curstack), (long)AvMAX(curstack));
68 #endif /* DEBUGGING */
77 I32 top = stack_sp - stack_base;
78 register I32 i = top - 30;
79 I32 *markscan = curstackinfo->si_markbase;
84 while (++markscan <= markstack_ptr)
89 PerlIO_printf(Perl_debug_log, i ? "0x%lx => ... " : "0x%lx => ",
92 PerlIO_printf(Perl_debug_log, i ? " => ... " : " => ");
93 #endif /* USE_THREADS */
94 if (stack_base[0] != &sv_undef || stack_sp < stack_base)
95 PerlIO_printf(Perl_debug_log, " [STACK UNDERFLOW!!!]\n");
98 if (markscan <= markstack_ptr && *markscan < i) {
101 PerlIO_putc(Perl_debug_log, '*');
103 while (markscan <= markstack_ptr && *markscan < i);
104 PerlIO_printf(Perl_debug_log, " ");
108 PerlIO_printf(Perl_debug_log, "%-4s ", SvPEEK(stack_base[i]));
111 PerlIO_printf(Perl_debug_log, "\n");
112 #endif /* DEBUGGING */