We just discovered PadWalker in #perl. This rules. Here's a patch to
make it compile under ithreads. Thanks!
R.
--- PadWalker.xs~ Sun May 27 18:59:38 2001
+++ PadWalker.xs Sun May 27 18:59:42 2001
@@ -29,14 +29,14 @@
dopoptosub(pTHX_ I32 startingblock)
{
dTHR;
- return dopoptosub_at(aTHX_ cxstack, startingblock);
+ return dopoptosub_at(cxstack, startingblock);
}
PERL_CONTEXT*
upcontext(pTHX_ I32 count)
{
PERL_SI *top_si = PL_curstackinfo;
- I32 cxix = dopoptosub(aTHX_ cxstack_ix);
+ I32 cxix = dopoptosub(cxstack_ix);
PERL_CONTEXT *cx;
PERL_CONTEXT *ccstack = cxstack;
I32 dbcxix;
@@ -46,7 +46,7 @@
while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
top_si = top_si->si_prev;
ccstack = top_si->si_cxstack;
- cxix = dopoptosub_at(aTHX_ ccstack, top_si->si_cxix);
+ cxix = dopoptosub_at(ccstack, top_si->si_cxix);
}
if (cxix < 0) {
return (PERL_CONTEXT *)0;
@@ -56,11 +56,11 @@
count++;
if (!count--)
break;
- cxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
+ cxix = dopoptosub_at(ccstack, cxix - 1);
}
cx = &ccstack[cxix];
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
- dbcxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
+ dbcxix = dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is defined for any cx. */
if (PL_DBsub && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv ==
GvCV(PL_DBsub))
@@ -137,7 +137,7 @@
I32 i;
PPCODE:
- cx = upcontext(aTHX_ uplevel);
+ cx = upcontext(uplevel);
if (!cx) {
//printf("(null context)\n");
--- PadWalker.xs~ Sun May 27 18:59:38 2001
+++ PadWalker.xs Sun May 27 18:59:42 2001
@@ -29,14 +29,14 @@
dopoptosub(pTHX_ I32 startingblock)
{
dTHR;
- return dopoptosub_at(aTHX_ cxstack, startingblock);
+ return dopoptosub_at(cxstack, startingblock);
}
PERL_CONTEXT*
upcontext(pTHX_ I32 count)
{
PERL_SI *top_si = PL_curstackinfo;
- I32 cxix = dopoptosub(aTHX_ cxstack_ix);
+ I32 cxix = dopoptosub(cxstack_ix);
PERL_CONTEXT *cx;
PERL_CONTEXT *ccstack = cxstack;
I32 dbcxix;
@@ -46,7 +46,7 @@
while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
top_si = top_si->si_prev;
ccstack = top_si->si_cxstack;
- cxix = dopoptosub_at(aTHX_ ccstack, top_si->si_cxix);
+ cxix = dopoptosub_at(ccstack, top_si->si_cxix);
}
if (cxix < 0) {
return (PERL_CONTEXT *)0;
@@ -56,11 +56,11 @@
count++;
if (!count--)
break;
- cxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
+ cxix = dopoptosub_at(ccstack, cxix - 1);
}
cx = &ccstack[cxix];
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
- dbcxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
+ dbcxix = dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is defined for any cx. */
if (PL_DBsub && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
@@ -137,7 +137,7 @@
I32 i;
PPCODE:
- cx = upcontext(aTHX_ uplevel);
+ cx = upcontext(uplevel);
if (!cx) {
//printf("(null context)\n");