Add line information to jumplevel debug information
Gerard Goossen [Thu, 12 Nov 2009 15:52:45 +0000 (16:52 +0100)]
Add information about where in the C code the jumplevel poping/setting up was done.

Gerard

From 7b95a19d6fbd3615a034cea79fa087b80e4a9555 Mon Sep 17 00:00:00 2001
From: Gerard Goossen <gerard@ggoossen.net>
Date: Thu, 12 Nov 2009 16:50:13 +0100
Subject: [PATCH] Add line information to jumplevel debug information provided when using -Dl

Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>

cop.h

diff --git a/cop.h b/cop.h
index 93154c8..0348324 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -99,8 +99,9 @@ typedef struct jmpenv JMPENV;
 
 #define JMPENV_PUSH(v) \
     STMT_START {                                                       \
-       DEBUG_l(Perl_deb(aTHX_ "Setting up jumplevel %p, was %p\n",     \
-                        (void*)&cur_env, (void*)PL_top_env));                  \
+       DEBUG_l(Perl_deb(aTHX_ "Setting up jumplevel %p, was %p at %s:%d\n",    \
+                        (void*)&cur_env, (void*)PL_top_env,                    \
+                        __FILE__, __LINE__));                                  \
        cur_env.je_prev = PL_top_env;                                   \
        OP_REG_TO_MEM;                                                  \
        cur_env.je_ret = PerlProc_setjmp(cur_env.je_buf, SCOPE_SAVES_SIGNAL_MASK);              \
@@ -112,8 +113,9 @@ typedef struct jmpenv JMPENV;
 
 #define JMPENV_POP \
     STMT_START {                                                       \
-       DEBUG_l(Perl_deb(aTHX_ "popping jumplevel was %p, now %p\n",    \
-                        (void*)PL_top_env, (void*)cur_env.je_prev));                   \
+       DEBUG_l(Perl_deb(aTHX_ "popping jumplevel was %p, now %p at %s:%d\n",   \
+                        (void*)PL_top_env, (void*)cur_env.je_prev,             \
+                        __FILE__, __LINE__));                                  \
        assert(PL_top_env == &cur_env);                                 \
        PL_top_env = cur_env.je_prev;                                   \
     } STMT_END