I'm playing around with an idea for an alternative to DProf. It may
never come to fruition, but I'm getting a bit stuck at a basic point.
I was writing a function DB::sub which looks like this:
package DB;
sub sub {
&$sub;
}
All good so far. But now I want to disable debugging behaviour for all
the functions that I call from this, even if they are in a different
pacakge.
I tried resetting $^P, $^D, no joy.
I thought that using perl_call_sv with G_NODEBUG might work, but this
doesn't seem to either...
I tried similar function
XS(XS_DB_sub) {
...
SV* fn = newSVpv("DB::sub2", 0);
perl_call_sv( fn, GIMME_V | G_NODEBUG );
}
sub sub2 {
# disable debugging somehow
...
# enable debugging
&$sub;
# disable
...
# enable again
}
What happens is that sub2 calls a method, which calls DB::sub, which
calls method ... etc to seg fault.
If anybody has any suggestions I would much appreciate.
Thanks!
James