Re: Tracing Function Invocations

"John J. Barton" <[email protected]> Mon, 18 Feb 2008 18:35:06 -0800
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Daniel Gredler wrote:
> Hi guys,
> 
> I'm trying to use the jsdIDebuggerService interface in a Firefox extension
> to trace function invocations. Specifically, I'm using the debugger
> service's functionHook. This hook takes two arguments: the current frame and
> the invocation type.
> 
> However, I'm having trouble accessing the name of the function being
> invoked, as well as the names and values of the arguments being passed to
> the function. The problem is that frame.functionName and
> frame.script.functionObject refer to the function within which the
> invocation is made, not the function being invoked.
> 
> Has anyone used the functionHook to trace and/or log JavaScript function
> calls? If not, has anyone used a different method to do achieve this? I'm
> attaching a snippet of code below so as to give a better idea of what I'm
> doing (wrong).
> 
You can look at firebug-service.js in
http://code.google.com/p/fbug/source/browse/branches/firebug1.2/components/firebug-service.js
to see how step-in, step-out etc are implemented.

John.