how to debug komodo extension?

Posted by liucougar on 2010-12-11 18:17

I am working on a komodo extension (a fork of kjslint), and hoping to release it soon. However, I am facing some difficulties to debug the extension: if there is any syntax errors in the js file, the extension just silently fails, no error is printed to anywhere (I tired error console, and pass -v to komodo binary to get more output). In addition, if there is a run time error, I could not find any messages printed anywhere.

what do I need to do to see the syntax errors/runtime errors in my extension?

thanks

adamg | Sun, 2010-12-12 05:20

Simplest solution I found until now is:

        try {
            ...
        } catch (err) {
            DafizillaCommon.exception(err);
        }

Take a look at
https://dafizilla.svn.sourceforge.net/svnroot/dafizilla/trunk/komodo/

liucougar | Sun, 2010-12-12 12:15

thanks for the info. I am using something like alert(JSON.encode(err)) in the catch block, the problem is I have to add try/catch almost everywhere in my code (for each event handler)

I was hoping there is a better way of doing this...

ericp
ActiveState Staff
Mon, 2010-12-13 11:28

So you pretty much do need to wrap your full JS files in try/catch
blocks, at least during development.

If you're looking for a JS debugger, there's a variant of venkman
that works with Komodo at

http://community.activestate.com/xpi/venkman-javascript-debugger

- Eric

adamg | Mon, 2010-12-13 12:38

Venkman somehow does not work for me.
Any pointers how it should work?

ericp
ActiveState Staff
Mon, 2010-12-13 12:42

... which is why we used to have our own JavaScript debugger,
for debugging Firefox web pages. Have you used it before with
Firefox? There is a bit of a learning curve getting up to speed
with it.

- Eric

adamg | Mon, 2010-12-13 12:44

It was working in some earlier KO, but in 6.* if I put "debugger" into the code it does not stop...

ericp
ActiveState Staff
Mon, 2010-12-13 12:57

Although I've had no problem using venkman/komodo on all
three platforms.

- Eric

liucougar | Mon, 2010-12-13 15:36

set javascript.options.showInConsole = true

more details: http://www.liucougar.net/blog/archives/262