When a user calls XS
from main::
package we can not use
caller_cx(0, NULL);
because there is no frames for main::
and for XSUB
DOC
Note that XSUBs don't get a stack frame, so C will return information for the immediately-surrounding Perl code
How to get the file:line
info the XSUB
is called from, hints for main::
scope etc. info?
Copied from
mess_sv
(called by Perl API functionswarn
andcroak
, which append line information like the Perl functionswarn
anddie
):A little bit about
PL_curcop
here.