Re: Tracing Function Invocations
"Daniel Gredler" <[email protected]> Wed, 20 Feb 2008 09:54:55 -0500
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
Hi John, Based on the Firebug code, it looks like I need to hook the function invocations, and when a function is called, hook execution (interrupts). I can then get all the info I need in the interrupt, and unhook interrupts until the next function call. I had hoped that there was a better way, but it seems to work. Thanks for your help! Regards, Daniel On Mon, Feb 18, 2008 at 9:35 PM, John J. Barton <[email protected]> wrote: > 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. > _______________________________________________ > dev-apps-js-debugger mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-apps-js-debugger > -- Daniel Gredler http://daniel.gredler.net/