This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename DEBUG_CX() to CX_DEBUG()
authorDavid Mitchell <davem@iabyn.com>
Wed, 21 Oct 2015 08:41:52 +0000 (09:41 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:18:31 +0000 (09:18 +0000)
For consistency with the new naming convention for context-stack macros.
Also, give it a cx arg rather than using CX_CUR()

cop.h
pp_ctl.c

diff --git a/cop.h b/cop.h
index 94e58af..208223f 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -930,16 +930,16 @@ struct block {
 #define blk_loop       cx_u.cx_blk.blk_u.blku_loop
 #define blk_givwhen    cx_u.cx_blk.blk_u.blku_givwhen
 
-#define DEBUG_CX(action)                                               \
+#define CX_DEBUG(cx, action)                                           \
     DEBUG_l(                                                           \
        Perl_deb(aTHX_ "CX %ld %s %s (scope %ld,%ld) (save %ld,%ld) at %s:%d\n",\
                    (long)cxstack_ix,                                   \
                    action,                                             \
-                   PL_block_type[CxTYPE(CX_CUR())],                    \
+                   PL_block_type[CxTYPE(cx)],                          \
                    (long)PL_scopestack_ix,                             \
-                   (long)(CX_CUR()->blk_oldscopesp),                   \
+                   (long)(cx->blk_oldscopesp),                         \
                    (long)PL_savestack_ix,                              \
-                   (long)(CX_CUR()->blk_oldsaveix),                    \
+                   (long)(cx->blk_oldsaveix),                          \
                    __FILE__, __LINE__));
 
 /* Enter a block. */
@@ -953,11 +953,11 @@ struct block {
        cx->blk_gimme           = (U8)gimme;                            \
         cx->cx_u.cx_blk.blku_old_tmpsfloor = PL_tmps_floor;             \
         PL_tmps_floor           = PL_tmps_ix;                           \
-       DEBUG_CX("PUSH");
+       CX_DEBUG(cx, "PUSH");
 
 /* Exit a block (RETURN and LAST). */
 #define POPBLOCK(cx)                                                   \
-       DEBUG_CX("POP");                                                \
+       CX_DEBUG(cx, "POP");                                            \
        PL_curcop        = cx->blk_oldcop,                              \
        PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp,            \
        PL_scopestack_ix = cx->blk_oldscopesp,                          \
@@ -971,8 +971,8 @@ struct block {
 
 /* Continue a block elsewhere (NEXT and REDO). */
 #define TOPBLOCK(cx)                                                   \
-       DEBUG_CX("TOP");                                                \
-       cx = CX_CUR(),                                                  \
+       cx = CX_CUR();                                                  \
+       CX_DEBUG(cx, "TOP");                                            \
        PL_stack_sp      = PL_stack_base + cx->blk_oldsp,               \
        PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp,            \
        PL_scopestack_ix = cx->blk_oldscopesp,                          \
index 045e1d3..f2c30f4 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1513,7 +1513,8 @@ Perl_dounwind(pTHX_ I32 cxix)
 
     while (cxstack_ix > cxix) {
         PERL_CONTEXT *cx = CX_CUR();
-       DEBUG_CX("UNWIND");
+
+       CX_DEBUG(cx, "UNWIND");
        /* Note: we don't need to restore the base context info till the end. */
 
         CX_LEAVE_SCOPE(cx);
@@ -1811,7 +1812,7 @@ PP(pp_caller)
        RETURN;
     }
 
-    DEBUG_CX("CALLER");
+    CX_DEBUG(cx, "CALLER");
     assert(CopSTASH(cx->blk_oldcop));
     stash_hek = SvTYPE(CopSTASH(cx->blk_oldcop)) == SVt_PVHV
       ? HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop))