summaryrefslogtreecommitdiff
path: root/deb.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
commit11343788cbaaede18e3146b5219d2fbdaeaf516e (patch)
treeef2be09ece0508b3408a222a86980d39e20bcd42 /deb.c
parenta4f68e9b64464684b732bc17fd65ed4a1aa4708c (diff)
downloadperl-11343788cbaaede18e3146b5219d2fbdaeaf516e.tar.gz
Initial 3-way merge from (5.001m, thr1m, 5.003) plus fixups.
p4raw-id: //depot/thrperl@4
Diffstat (limited to 'deb.c')
-rw-r--r--deb.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/deb.c b/deb.c
index f518b19ad2..729c47ec33 100644
--- a/deb.c
+++ b/deb.c
@@ -27,12 +27,20 @@ void
deb(pat,a1,a2,a3,a4,a5,a6,a7,a8)
char *pat;
{
+ dTHR;
register I32 i;
GV* gv = curcop->cop_filegv;
+#ifdef USE_THREADS
+ fprintf(stderr,"0x%lx (%s:%ld)\t",
+ (unsigned long) thr,
+ SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
+ (long)curcop->cop_line);
+#else
fprintf(stderr,"(%s:%ld)\t",
SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
(long)curcop->cop_line);
+#endif /* USE_THREADS */
for (i=0; i<dlevel; i++)
fprintf(stderr,"%c%c ",debname[i],debdelim[i]);
fprintf(stderr,pat,a1,a2,a3,a4,a5,a6,a7,a8);
@@ -51,13 +59,21 @@ deb(pat, va_alist)
va_dcl
# endif
{
+ dTHR;
va_list args;
register I32 i;
GV* gv = curcop->cop_filegv;
+#ifdef USE_THREADS
+ fprintf(stderr,"0x%lx (%s:%ld)\t",
+ (unsigned long) thr,
+ SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
+ (long)curcop->cop_line);
+#else
fprintf(stderr,"(%s:%ld)\t",
SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
(long)curcop->cop_line);
+#endif /* USE_THREADS */
for (i=0; i<dlevel; i++)
fprintf(stderr,"%c%c ",debname[i],debdelim[i]);
@@ -82,6 +98,7 @@ deb_growlevel()
I32
debstackptrs()
{
+ dTHR;
fprintf(stderr, "%8lx %8lx %8ld %8ld %8ld\n",
(unsigned long)stack, (unsigned long)stack_base,
(long)*markstack_ptr, (long)(stack_sp-stack_base),
@@ -95,6 +112,7 @@ debstackptrs()
I32
debstack()
{
+ dTHR;
I32 top = stack_sp - stack_base;
register I32 i = top - 30;
I32 *markscan = markstack;
@@ -106,7 +124,12 @@ debstack()
if (*markscan >= i)
break;
+#ifdef USE_THREADS
+ fprintf(stderr, i ? "0x%lx => ... " : "0x%lx => ",
+ (unsigned long) thr);
+#else
fprintf(stderr, i ? " => ... " : " => ");
+#endif /* USE_THREADS */
if (stack_base[0] != &sv_undef || stack_sp < stack_base)
fprintf(stderr, " [STACK UNDERFLOW!!!]\n");
do {