Steve <[EMAIL PROTECTED]> writes:
>Argh!!
>
>Ok, I seem to be muddying the waters more and more with each post! The
>*first* frame is indeed the one I'm interested in (whole point of using
>Carp in the first place!). But it's got no useful data in it all.
>
>So, while I've misstated the situation, my question stands. How
>practical would it be to manipulate the data on the call stack?

I don't know. 

The /dev/null is comming from 

    char               *my_argv[] = { "", "/dev/null" };
    perl_parse(my_perl, xs_init, 2, my_argv, (char **) NULL);

I usually use a "-e"  rather than /dev/null ('cos I once used 
this on Win32 where there isn't a /dev/null).

So you could probably fake the info you want _once_ by 
changing your perl_parse() call to pass args: 
  -e "#line 42 \"pseudofile.c\"\n"

To changed it on a call-by-call basis is a bit more tricky.
(But as C code can see whole of perl's data structuctures - possible.)

I _think_ the information caller() sees for this outer level comes 
from PL_curcop at the time of the call_method().

[curcop = "current control op" or some such - it roughly corresponds 
to a "statement" in a perl script. ]

So 

   PL_curcop->cop_file = __FILE__;
   PL_curcop->cop_line = __LINE__;
   count = call_method("do_something", G_SCALAR);

may do what I think you want.
I am not 100% sure you can just clobber cop_file like that 
(i.e. someing _MIGHT_ try and SafeFree() its value.)
You may want to poke about in sources to see, or try it, or if you must 
ask again here and I will dig deeper.

So a safer scheme might be use an ENTER/LEAVE round it with 
appropriate SAVEXXXX() to save/restore cop_*.

Or perhaps fake a whole new COP struct and save/restore PL_curcop
I think I have done something like that latter once.    









>
>pardon me and thanks again-

Reply via email to