summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2012-09-16 16:31:23 +0200
committerVincent Pit <perl@profvince.com>2012-09-16 17:16:22 +0200
commite8d9e9d0c5f9426c78756a60f2b68e10f38ce40e (patch)
treeff0d1ad948a4ff477b24e5da68bfcac44af556ec /scope.c
parent72581b5b7341e76b3ea364b4d49c8340bb668228 (diff)
downloadperl-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.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index eabdbd2f26..6f8a8b2884 100644
--- a/scope.c
+++ b/scope.c
@@ -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: