On Fri, Aug 05, 2005 at 09:24:29PM +0100, Alan Burlison wrote:
> Hmm, having looked a the 165 lines of code needed to implement caller() 
> I'm not sure that this is going to be lightweight enough to be practical.

Caller is mostly doing hard stuff.

A lot depends on the detail of when and how the dtrace stuff gets called, but:

in principle, at the point a sub is called, the associated CV can be found
using cv=find_runcv(); CvGV(cv) will then give the typeglob associated
with it, and thus the name; the first op pointed to by CvSTART(cv) should
be a control op, which will give you the filename and line number of the
start of the function.

The hard bit is getting the dtrace stuff called at the right point.
Not knowing how dtrace works, I can't really comment further.


-- 
Fire extinguisher (n) a device for holding open fire doors.

Reply via email to