diff options
author | Vincent Pit <perl@profvince.com> | 2012-09-16 16:31:23 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2012-09-16 17:16:22 +0200 |
commit | e8d9e9d0c5f9426c78756a60f2b68e10f38ce40e (patch) | |
tree | ff0d1ad948a4ff477b24e5da68bfcac44af556ec /scope.c | |
parent | 72581b5b7341e76b3ea364b4d49c8340bb668228 (diff) | |
download | perl-e8d9e9d0c5f9426c78756a60f2b68e10f38ce40e.tar.gz |
Make cx_dump() display the correct gimme description
Contexts are no longer what they used to be back in 1996.
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1193,6 +1193,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx) #ifdef DEBUGGING PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]); if (CxTYPE(cx) != CXt_SUBST) { + const char *gimme_text; PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp); PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n", PTR2UV(cx->blk_oldcop)); @@ -1200,7 +1201,21 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx) PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp); PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n", PTR2UV(cx->blk_oldpm)); - PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR"); + switch (cx->blk_gimme) { + case G_VOID: + gimme_text = "VOID"; + break; + case G_SCALAR: + gimme_text = "SCALAR"; + break; + case G_ARRAY: + gimme_text = "LIST"; + break; + default: + gimme_text = "UNKNOWN"; + break; + } + PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", gimme_text); } switch (CxTYPE(cx)) { case CXt_NULL: |