Re: venkman and stdout
Unknown <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Oops, I didn't test that suggestion, and I've been away from Venkman for
long enough that I forgot some of the finer points :) Sorry about that.
From xpcshell, you could do something like...
ctrid = "@mozilla.org/js/jsd/debugger-service;1";
ifc = Components.interfaces.jsdIDebuggerService;
jsds = Components.classes[ctrid].getService(ifc);
jsds.on();
jsds.interruptHook = { onExecute: dumpframe };
Again, I havn't tested this, but it should be enough of a clue to get
you started. For more "documentation" on the debugger component, see
http://lxr.mozilla.org/mozilla/source/js/jsd/idl/jsdIDebuggerService.idl.
Rob.
Alexis Nikichine wrote:
> Robert Ginda wrote:
>
>
>>That'll slow things down quite a bit, but shouldn't be too difficult
>>otherwise. Try creating a file with the following contents...
>>
>>function dumpframe(frame)
>>{
>> dd(formatFrame(frame));
>>}
>>
>>Then in venkman, /loadd file:///path/to/file.js, and /evald
>>console.jsds.interruptHook = dumpframe. To stop the dumps, type /evald
>>console.jsds.interruptHook = null;
>>
>>You'll probably want to add some appropriate filtering. See
>>
>
> http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-debugger.js#1774
>
>>for the implementation of formatFrame.
>>
>>You'll also have to enable javascript dump output for dd() to work.
>>
>
>
> Oh great. Well, not so. I could not have dd working (never heard of it,
> btw), and interruptHook expects a jsdIExecutionHook object, etc... but
> could reach something decent anyway; Well, I still have to format the
> frame, and have screens filled with [xpconnect wrapped jsdIStackFrame]
> stuff, but I feel quite near to my goal
>
> That won't keep me asking my next question : is it possible to access this
> console.jsds.interruptHook functionnality when running the script from
> xpcshell ? Looking for a text mode Venkman ? Me ?? :-)
>
>
> Alexis
>
> PS. Your answer opened my eyes as to the power of this debugger!
>
> -- some domain is free