This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pod/perlipc.pod patch
[perl5.git] / scope.c
CommitLineData
a0d0e21e 1/* scope.c
79072805 2 *
a0d0e21e 3 * Copyright (c) 1991-1994, Larry Wall
79072805
LW
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 *
a0d0e21e
LW
8 */
9
10/*
11 * "For the fashion of Minas Tirith was such that it was built on seven
12 * levels..."
79072805
LW
13 */
14
15#include "EXTERN.h"
16#include "perl.h"
17
a0d0e21e
LW
18SV**
19stack_grow(sp, p, n)
20SV** sp;
21SV** p;
22int n;
23{
24 stack_sp = sp;
1f96a9ed 25 av_extend(curstack, (p - stack_base) + (n) + 128);
a0d0e21e
LW
26 return stack_sp;
27}
28
79072805
LW
29I32
30cxinc()
31{
32 cxstack_max = cxstack_max * 3 / 2;
a38d6535 33 Renew(cxstack, cxstack_max + 1, CONTEXT); /* XXX should fix CXINC macro */
79072805
LW
34 return cxstack_ix + 1;
35}
36
37void
38push_return(retop)
39OP *retop;
40{
41 if (retstack_ix == retstack_max) {
42 retstack_max = retstack_max * 3 / 2;
43 Renew(retstack, retstack_max, OP*);
44 }
45 retstack[retstack_ix++] = retop;
46}
47
48OP *
49pop_return()
50{
51 if (retstack_ix > 0)
52 return retstack[--retstack_ix];
53 else
54 return Nullop;
55}
56
57void
58push_scope()
59{
60 if (scopestack_ix == scopestack_max) {
61 scopestack_max = scopestack_max * 3 / 2;
62 Renew(scopestack, scopestack_max, I32);
63 }
64 scopestack[scopestack_ix++] = savestack_ix;
65
66}
67
68void
69pop_scope()
70{
71 I32 oldsave = scopestack[--scopestack_ix];
8990e307 72 LEAVE_SCOPE(oldsave);
79072805
LW
73}
74
75void
a0d0e21e
LW
76markstack_grow()
77{
78 I32 oldmax = markstack_max - markstack;
79 I32 newmax = oldmax * 3 / 2;
80
81 Renew(markstack, newmax, I32);
82 markstack_ptr = markstack + oldmax;
83 markstack_max = markstack + newmax;
84}
85
86void
79072805
LW
87savestack_grow()
88{
89 savestack_max = savestack_max * 3 / 2;
90 Renew(savestack, savestack_max, ANY);
91}
92
93void
94free_tmps()
95{
96 /* XXX should tmps_floor live in cxstack? */
97 I32 myfloor = tmps_floor;
98 while (tmps_ix > myfloor) { /* clean up after last statement */
99 SV* sv = tmps_stack[tmps_ix];
100 tmps_stack[tmps_ix--] = Nullsv;
463ee0b2
LW
101 if (sv) {
102#ifdef DEBUGGING
103 SvTEMP_off(sv);
104#endif
8990e307 105 SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
463ee0b2 106 }
79072805
LW
107 }
108}
109
110SV *
111save_scalar(gv)
112GV *gv;
113{
114 register SV *sv;
115 SV *osv = GvSV(gv);
116
117 SSCHECK(3);
118 SSPUSHPTR(gv);
119 SSPUSHPTR(osv);
120 SSPUSHINT(SAVEt_SV);
121
122 sv = GvSV(gv) = NEWSV(0,0);
a0d0e21e 123 if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
79072805 124 sv_upgrade(sv, SvTYPE(osv));
a0d0e21e 125 if (SvGMAGICAL(osv)) {
748a9306
LW
126 MAGIC* mg;
127 bool oldtainted = tainted;
a0d0e21e 128 mg_get(osv);
748a9306
LW
129 if (tainting && tainted && (mg = mg_find(osv, 't'))) {
130 SAVESPTR(mg->mg_obj);
131 mg->mg_obj = osv;
132 }
a0d0e21e
LW
133 SvFLAGS(osv) |= (SvFLAGS(osv) &
134 (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
748a9306 135 tainted = oldtainted;
a0d0e21e 136 }
79072805 137 SvMAGIC(sv) = SvMAGIC(osv);
a0d0e21e 138 SvFLAGS(sv) |= SvMAGICAL(osv);
748a9306 139 localizing = 1;
79072805 140 SvSETMAGIC(sv);
748a9306 141 localizing = 0;
79072805
LW
142 }
143 return sv;
144}
145
146#ifdef INLINED_ELSEWHERE
147void
148save_gp(gv)
149GV *gv;
150{
151 register GP *gp;
152 GP *ogp = GvGP(gv);
153
154 SSCHECK(3);
4633a7c4 155 SSPUSHPTR(SvREFCNT_inc(gv));
79072805
LW
156 SSPUSHPTR(ogp);
157 SSPUSHINT(SAVEt_GP);
158
159 Newz(602,gp, 1, GP);
160 GvGP(gv) = gp;
161 GvREFCNT(gv) = 1;
162 GvSV(gv) = NEWSV(72,0);
163 GvLINE(gv) = curcop->cop_line;
164 GvEGV(gv) = gv;
165}
166#endif
167
168SV*
169save_svref(sptr)
170SV **sptr;
171{
172 register SV *sv;
173 SV *osv = *sptr;
174
175 SSCHECK(3);
176 SSPUSHPTR(*sptr);
177 SSPUSHPTR(sptr);
178 SSPUSHINT(SAVEt_SVREF);
179
180 sv = *sptr = NEWSV(0,0);
a0d0e21e 181 if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
79072805 182 sv_upgrade(sv, SvTYPE(osv));
a0d0e21e 183 if (SvGMAGICAL(osv)) {
748a9306
LW
184 MAGIC* mg;
185 bool oldtainted = tainted;
a0d0e21e 186 mg_get(osv);
748a9306
LW
187 if (tainting && tainted && (mg = mg_find(osv, 't'))) {
188 SAVESPTR(mg->mg_obj);
189 mg->mg_obj = osv;
190 }
a0d0e21e
LW
191 SvFLAGS(osv) |= (SvFLAGS(osv) &
192 (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
748a9306 193 tainted = oldtainted;
a0d0e21e 194 }
79072805 195 SvMAGIC(sv) = SvMAGIC(osv);
a0d0e21e 196 SvFLAGS(sv) |= SvMAGICAL(osv);
748a9306 197 localizing = 1;
79072805 198 SvSETMAGIC(sv);
748a9306 199 localizing = 0;
79072805
LW
200 }
201 return sv;
202}
203
204AV *
205save_ary(gv)
206GV *gv;
207{
208 SSCHECK(3);
209 SSPUSHPTR(gv);
210 SSPUSHPTR(GvAVn(gv));
211 SSPUSHINT(SAVEt_AV);
212
213 GvAV(gv) = Null(AV*);
214 return GvAVn(gv);
215}
216
217HV *
218save_hash(gv)
219GV *gv;
220{
221 SSCHECK(3);
222 SSPUSHPTR(gv);
223 SSPUSHPTR(GvHVn(gv));
224 SSPUSHINT(SAVEt_HV);
225
226 GvHV(gv) = Null(HV*);
227 return GvHVn(gv);
228}
229
230void
231save_item(item)
232register SV *item;
233{
234 register SV *sv;
235
236 SSCHECK(3);
237 SSPUSHPTR(item); /* remember the pointer */
238 sv = NEWSV(0,0);
239 sv_setsv(sv,item);
240 SSPUSHPTR(sv); /* remember the value */
241 SSPUSHINT(SAVEt_ITEM);
242}
243
244void
245save_int(intp)
246int *intp;
247{
248 SSCHECK(3);
249 SSPUSHINT(*intp);
250 SSPUSHPTR(intp);
251 SSPUSHINT(SAVEt_INT);
252}
253
254void
85e6fe83
LW
255save_long(longp)
256long *longp;
257{
258 SSCHECK(3);
259 SSPUSHLONG(*longp);
260 SSPUSHPTR(longp);
261 SSPUSHINT(SAVEt_LONG);
262}
263
264void
79072805
LW
265save_I32(intp)
266I32 *intp;
267{
268 SSCHECK(3);
269 SSPUSHINT(*intp);
270 SSPUSHPTR(intp);
271 SSPUSHINT(SAVEt_I32);
272}
273
a0d0e21e 274void
55497cff
PP
275save_I16(intp)
276I16 *intp;
277{
278 SSCHECK(3);
279 SSPUSHINT(*intp);
280 SSPUSHPTR(intp);
281 SSPUSHINT(SAVEt_I16);
282}
283
284void
a0d0e21e
LW
285save_iv(ivp)
286IV *ivp;
287{
288 SSCHECK(3);
4aa0a1f7 289 SSPUSHIV(*ivp);
a0d0e21e
LW
290 SSPUSHPTR(ivp);
291 SSPUSHINT(SAVEt_IV);
292}
293
85e6fe83
LW
294/* Cannot use save_sptr() to store a char* since the SV** cast will
295 * force word-alignment and we'll miss the pointer.
296 */
297void
298save_pptr(pptr)
299char **pptr;
300{
301 SSCHECK(3);
302 SSPUSHPTR(*pptr);
303 SSPUSHPTR(pptr);
304 SSPUSHINT(SAVEt_PPTR);
305}
306
79072805
LW
307void
308save_sptr(sptr)
309SV **sptr;
310{
311 SSCHECK(3);
312 SSPUSHPTR(*sptr);
313 SSPUSHPTR(sptr);
314 SSPUSHINT(SAVEt_SPTR);
315}
316
317void
318save_nogv(gv)
319GV *gv;
320{
321 SSCHECK(2);
322 SSPUSHPTR(gv);
323 SSPUSHINT(SAVEt_NSTAB);
324}
325
326void
327save_hptr(hptr)
328HV **hptr;
329{
330 SSCHECK(3);
85e6fe83 331 SSPUSHPTR(*hptr);
79072805
LW
332 SSPUSHPTR(hptr);
333 SSPUSHINT(SAVEt_HPTR);
334}
335
336void
337save_aptr(aptr)
338AV **aptr;
339{
340 SSCHECK(3);
85e6fe83 341 SSPUSHPTR(*aptr);
79072805
LW
342 SSPUSHPTR(aptr);
343 SSPUSHINT(SAVEt_APTR);
344}
345
346void
8990e307
LW
347save_freesv(sv)
348SV *sv;
349{
350 SSCHECK(2);
351 SSPUSHPTR(sv);
352 SSPUSHINT(SAVEt_FREESV);
353}
354
355void
356save_freeop(op)
357OP *op;
358{
359 SSCHECK(2);
360 SSPUSHPTR(op);
361 SSPUSHINT(SAVEt_FREEOP);
362}
363
364void
365save_freepv(pv)
366char *pv;
367{
368 SSCHECK(2);
369 SSPUSHPTR(pv);
370 SSPUSHINT(SAVEt_FREEPV);
371}
372
373void
374save_clearsv(svp)
375SV** svp;
376{
377 SSCHECK(2);
4aa0a1f7 378 SSPUSHLONG((long)(svp-curpad));
8990e307
LW
379 SSPUSHINT(SAVEt_CLEARSV);
380}
381
382void
383save_delete(hv,key,klen)
384HV *hv;
385char *key;
386I32 klen;
387{
388 SSCHECK(4);
389 SSPUSHINT(klen);
390 SSPUSHPTR(key);
391 SSPUSHPTR(hv);
392 SSPUSHINT(SAVEt_DELETE);
393}
394
395void
79072805
LW
396save_list(sarg,maxsarg)
397register SV **sarg;
398I32 maxsarg;
399{
400 register SV *sv;
401 register I32 i;
402
403 SSCHECK(3 * maxsarg);
404 for (i = 1; i <= maxsarg; i++) {
405 SSPUSHPTR(sarg[i]); /* remember the pointer */
406 sv = NEWSV(0,0);
407 sv_setsv(sv,sarg[i]);
408 SSPUSHPTR(sv); /* remember the value */
409 SSPUSHINT(SAVEt_ITEM);
410 }
411}
412
413void
a0d0e21e
LW
414save_destructor(f,p)
415void (*f) _((void*));
416void* p;
417{
418 SSCHECK(3);
419 SSPUSHDPTR(f);
420 SSPUSHPTR(p);
421 SSPUSHINT(SAVEt_DESTRUCTOR);
422}
423
424void
79072805
LW
425leave_scope(base)
426I32 base;
427{
428 register SV *sv;
429 register SV *value;
430 register GV *gv;
431 register AV *av;
432 register HV *hv;
433 register void* ptr;
434
435 if (base < -1)
463ee0b2 436 croak("panic: corrupt saved stack index");
79072805
LW
437 while (savestack_ix > base) {
438 switch (SSPOPINT) {
439 case SAVEt_ITEM: /* normal string */
440 value = (SV*)SSPOPPTR;
441 sv = (SV*)SSPOPPTR;
442 sv_replace(sv,value);
748a9306 443 localizing = 2;
79072805 444 SvSETMAGIC(sv);
748a9306 445 localizing = 0;
79072805
LW
446 break;
447 case SAVEt_SV: /* scalar reference */
448 value = (SV*)SSPOPPTR;
449 gv = (GV*)SSPOPPTR;
450 sv = GvSV(gv);
748a9306
LW
451 if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
452 SvTYPE(sv) != SVt_PVGV)
453 {
a0d0e21e 454 (void)SvUPGRADE(value, SvTYPE(sv));
85e6fe83 455 SvMAGIC(value) = SvMAGIC(sv);
a0d0e21e
LW
456 SvFLAGS(value) |= SvMAGICAL(sv);
457 SvMAGICAL_off(sv);
79072805 458 SvMAGIC(sv) = 0;
85e6fe83 459 }
8990e307 460 SvREFCNT_dec(sv);
a0d0e21e 461 GvSV(gv) = value;
748a9306 462 localizing = 2;
a0d0e21e 463 SvSETMAGIC(value);
748a9306 464 localizing = 0;
79072805
LW
465 break;
466 case SAVEt_SVREF: /* scalar reference */
467 ptr = SSPOPPTR;
468 sv = *(SV**)ptr;
a0d0e21e 469 value = (SV*)SSPOPPTR;
748a9306
LW
470 if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
471 SvTYPE(sv) != SVt_PVGV)
472 {
a0d0e21e
LW
473 (void)SvUPGRADE(value, SvTYPE(sv));
474 SvMAGIC(value) = SvMAGIC(sv);
475 SvFLAGS(value) |= SvMAGICAL(sv);
476 SvMAGICAL_off(sv);
79072805 477 SvMAGIC(sv) = 0;
a0d0e21e 478 }
8990e307 479 SvREFCNT_dec(sv);
a0d0e21e 480 *(SV**)ptr = value;
748a9306 481 localizing = 2;
a0d0e21e 482 SvSETMAGIC(value);
748a9306 483 localizing = 0;
79072805
LW
484 break;
485 case SAVEt_AV: /* array reference */
486 av = (AV*)SSPOPPTR;
487 gv = (GV*)SSPOPPTR;
8990e307 488 SvREFCNT_dec(GvAV(gv));
79072805
LW
489 GvAV(gv) = av;
490 break;
491 case SAVEt_HV: /* hash reference */
492 hv = (HV*)SSPOPPTR;
493 gv = (GV*)SSPOPPTR;
8990e307 494 SvREFCNT_dec(GvHV(gv));
79072805
LW
495 GvHV(gv) = hv;
496 break;
497 case SAVEt_INT: /* int reference */
498 ptr = SSPOPPTR;
499 *(int*)ptr = (int)SSPOPINT;
500 break;
85e6fe83
LW
501 case SAVEt_LONG: /* long reference */
502 ptr = SSPOPPTR;
503 *(long*)ptr = (long)SSPOPLONG;
504 break;
79072805
LW
505 case SAVEt_I32: /* I32 reference */
506 ptr = SSPOPPTR;
507 *(I32*)ptr = (I32)SSPOPINT;
508 break;
55497cff
PP
509 case SAVEt_I16: /* I16 reference */
510 ptr = SSPOPPTR;
511 *(I16*)ptr = (I16)SSPOPINT;
512 break;
a0d0e21e
LW
513 case SAVEt_IV: /* IV reference */
514 ptr = SSPOPPTR;
515 *(IV*)ptr = (IV)SSPOPIV;
516 break;
79072805
LW
517 case SAVEt_SPTR: /* SV* reference */
518 ptr = SSPOPPTR;
519 *(SV**)ptr = (SV*)SSPOPPTR;
520 break;
85e6fe83
LW
521 case SAVEt_PPTR: /* char* reference */
522 ptr = SSPOPPTR;
523 *(char**)ptr = (char*)SSPOPPTR;
524 break;
79072805
LW
525 case SAVEt_HPTR: /* HV* reference */
526 ptr = SSPOPPTR;
527 *(HV**)ptr = (HV*)SSPOPPTR;
528 break;
529 case SAVEt_APTR: /* AV* reference */
530 ptr = SSPOPPTR;
531 *(AV**)ptr = (AV*)SSPOPPTR;
532 break;
533 case SAVEt_NSTAB:
534 gv = (GV*)SSPOPPTR;
1f96a9ed 535 (void)sv_clear((SV*)gv);
79072805
LW
536 break;
537 case SAVEt_GP: /* scalar reference */
538 ptr = SSPOPPTR;
539 gv = (GV*)SSPOPPTR;
540 gp_free(gv);
541 GvGP(gv) = (GP*)ptr;
4633a7c4 542 SvREFCNT_dec(gv);
79072805 543 break;
8990e307
LW
544 case SAVEt_FREESV:
545 ptr = SSPOPPTR;
546 SvREFCNT_dec((SV*)ptr);
547 break;
548 case SAVEt_FREEOP:
549 ptr = SSPOPPTR;
550 curpad = AvARRAY(comppad);
551 op_free((OP*)ptr);
552 break;
553 case SAVEt_FREEPV:
554 ptr = SSPOPPTR;
555 Safefree((char*)ptr);
556 break;
557 case SAVEt_CLEARSV:
4aa0a1f7 558 ptr = (void*)&curpad[SSPOPLONG];
8990e307 559 sv = *(SV**)ptr;
a0d0e21e 560 if (SvREFCNT(sv) <= 1) { /* Can clear pad variable in place. */
8990e307
LW
561 if (SvTHINKFIRST(sv)) {
562 if (SvREADONLY(sv))
563 croak("panic: leave_scope clearsv");
564 if (SvROK(sv))
565 sv_unref(sv);
566 }
a0d0e21e
LW
567 if (SvMAGICAL(sv))
568 mg_free(sv);
8990e307
LW
569
570 switch (SvTYPE(sv)) {
571 case SVt_NULL:
572 break;
573 case SVt_PVAV:
574 av_clear((AV*)sv);
575 break;
576 case SVt_PVHV:
577 hv_clear((HV*)sv);
578 break;
579 case SVt_PVCV:
580 sub_generation++;
85e6fe83 581 cv_undef((CV*)sv);
8990e307
LW
582 break;
583 default:
584 if (SvPOK(sv) && SvLEN(sv))
a0d0e21e
LW
585 (void)SvOOK_off(sv);
586 (void)SvOK_off(sv);
8990e307
LW
587 break;
588 }
589 }
590 else { /* Someone has a claim on this, so abandon it. */
4aa0a1f7 591 U32 padflags = SvFLAGS(sv) & (SVs_PADBUSY|SVs_PADMY|SVs_PADTMP);
8990e307
LW
592 SvREFCNT_dec(sv); /* Cast current value to the winds. */
593 switch (SvTYPE(sv)) { /* Console ourselves with a new value */
594 case SVt_PVAV: *(SV**)ptr = (SV*)newAV(); break;
595 case SVt_PVHV: *(SV**)ptr = (SV*)newHV(); break;
596 default: *(SV**)ptr = NEWSV(0,0); break;
597 }
4aa0a1f7 598 SvFLAGS(*(SV**)ptr) |= padflags; /* preserve pad nature */
8990e307
LW
599 }
600 break;
601 case SAVEt_DELETE:
602 ptr = SSPOPPTR;
603 hv = (HV*)ptr;
604 ptr = SSPOPPTR;
748a9306 605 (void)hv_delete(hv, (char*)ptr, (U32)SSPOPINT, G_DISCARD);
adbc6bb1 606 Safefree(ptr);
8990e307 607 break;
a0d0e21e
LW
608 case SAVEt_DESTRUCTOR:
609 ptr = SSPOPPTR;
610 (*SSPOPDPTR)(ptr);
611 break;
612 case SAVEt_REGCONTEXT:
8e07c86e
AD
613 {
614 I32 delta = SSPOPINT;
615 savestack_ix -= delta; /* regexp must have croaked */
616 }
a0d0e21e 617 break;
55497cff
PP
618 case SAVEt_STACK_POS: /* Position on Perl stack */
619 {
620 I32 delta = SSPOPINT;
621 stack_sp = stack_base + delta;
622 }
623 break;
79072805 624 default:
463ee0b2 625 croak("panic: leave_scope inconsistency");
79072805
LW
626 }
627 }
628}
8990e307
LW
629
630#ifdef DEBUGGING
1f96a9ed 631
8990e307
LW
632void
633cx_dump(cx)
634CONTEXT* cx;
635{
760ac839 636 PerlIO_printf(Perl_debug_log, "CX %d = %s\n", cx - cxstack, block_type[cx->cx_type]);
8990e307 637 if (cx->cx_type != CXt_SUBST) {
760ac839
LW
638 PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
639 PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%lx\n", (long)cx->blk_oldcop);
640 PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
641 PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
642 PerlIO_printf(Perl_debug_log, "BLK_OLDRETSP = %ld\n", (long)cx->blk_oldretsp);
643 PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%lx\n", (long)cx->blk_oldpm);
644 PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
8990e307
LW
645 }
646 switch (cx->cx_type) {
647 case CXt_NULL:
648 case CXt_BLOCK:
649 break;
650 case CXt_SUB:
760ac839 651 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%lx\n",
8990e307 652 (long)cx->blk_sub.cv);
760ac839 653 PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%lx\n",
8990e307 654 (long)cx->blk_sub.gv);
760ac839 655 PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%lx\n",
8990e307 656 (long)cx->blk_sub.dfoutgv);
760ac839 657 PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
8990e307 658 (long)cx->blk_sub.olddepth);
760ac839 659 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
8990e307
LW
660 (int)cx->blk_sub.hasargs);
661 break;
662 case CXt_EVAL:
760ac839 663 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
8990e307 664 (long)cx->blk_eval.old_in_eval);
760ac839 665 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n",
c07a80fd
PP
666 op_name[cx->blk_eval.old_op_type],
667 op_desc[cx->blk_eval.old_op_type]);
760ac839 668 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
8990e307 669 cx->blk_eval.old_name);
760ac839 670 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%lx\n",
8990e307
LW
671 (long)cx->blk_eval.old_eval_root);
672 break;
673
674 case CXt_LOOP:
760ac839 675 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n",
8990e307 676 cx->blk_loop.label);
760ac839 677 PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
8990e307 678 (long)cx->blk_loop.resetsp);
760ac839 679 PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%lx\n",
8990e307 680 (long)cx->blk_loop.redo_op);
760ac839 681 PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%lx\n",
8990e307 682 (long)cx->blk_loop.next_op);
760ac839 683 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%lx\n",
8990e307 684 (long)cx->blk_loop.last_op);
760ac839 685 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
8990e307 686 (long)cx->blk_loop.iterix);
760ac839 687 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%lx\n",
8990e307 688 (long)cx->blk_loop.iterary);
760ac839 689 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%lx\n",
8990e307
LW
690 (long)cx->blk_loop.itervar);
691 if (cx->blk_loop.itervar)
760ac839 692 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%lx\n",
8990e307
LW
693 (long)cx->blk_loop.itersave);
694 break;
695
696 case CXt_SUBST:
760ac839 697 PerlIO_printf(Perl_debug_log, "SB_ITERS = %ld\n",
8990e307 698 (long)cx->sb_iters);
760ac839 699 PerlIO_printf(Perl_debug_log, "SB_MAXITERS = %ld\n",
8990e307 700 (long)cx->sb_maxiters);
760ac839 701 PerlIO_printf(Perl_debug_log, "SB_SAFEBASE = %ld\n",
8990e307 702 (long)cx->sb_safebase);
760ac839 703 PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
8990e307 704 (long)cx->sb_once);
760ac839 705 PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
8990e307 706 cx->sb_orig);
760ac839 707 PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%lx\n",
8990e307 708 (long)cx->sb_dstr);
760ac839 709 PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%lx\n",
8990e307 710 (long)cx->sb_targ);
760ac839 711 PerlIO_printf(Perl_debug_log, "SB_S = 0x%lx\n",
8990e307 712 (long)cx->sb_s);
760ac839 713 PerlIO_printf(Perl_debug_log, "SB_M = 0x%lx\n",
8990e307 714 (long)cx->sb_m);
760ac839 715 PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%lx\n",
8990e307 716 (long)cx->sb_strend);
760ac839 717 PerlIO_printf(Perl_debug_log, "SB_SUBBASE = 0x%lx\n",
8990e307
LW
718 (long)cx->sb_subbase);
719 break;
720 }
721}
722#endif