Announcing a new project on Trolltech Labs: Qt Script Debug. This is a collection of classes and tools that add debugging capabilities to applications that use Qt Script (Qt 4.4+ is needed). Embedding a debugger directly into an application can be done like this:
QScriptEmbeddedDebugger debugger; debugger.attachTo(/* Pointer to your QScriptEngine goes here*/);
Then just go on with your business as usual. When one of your scripts triggers an uncaught exception, a window like this will pop up. The debugger also adds a qs_break() function to your engine, so you can call that function from a script to bring up the debugger at a specific location. See the docs and examples (in particular the calculator_embed example) for details. For the graphically challenged, there’s a gdb-like debugger available.
One nice thing about the API is that it supports (actually, it’s designed for) out-of-process/remote debugging. This screenshot shows the stand-alone debugger running on a MacBook, debugging an application running on my Linux box.
Feedback and suggestions on debugging-related features and API you’d like to see for Qt Script are welcome. Happy debugging!
7 Responses to “No-Humbug-Debugging With Qt Script Debug”
Sounds neat Kent, where can we find the code?
@Richard Moore: oh, the URL to the code is at the project page, I guess it’s not that easy to spot.
So here it is: svn://labs.trolltech.com/svn/qtscript/qtscriptdebug
I figured out why I couldn’t see it. I looked in IE and the box with the information isn’t rendered! It works in firefox and Safari.
fantastic news! i can’t wait for 4.4 to be released! ![]()
@Richard: It shows up nicely in my Explorer. Which version are you using?
@Marius I used IE 6
So QSA Workbench is back in a much improved way …?
That’s great news!
Will QScript Debug also fancy a syntax highlighting script editor with auto completion?
How about the the QSA utility framework and Qt Widgets and auto layout that were directly available in QSA.
Will we see that in QScript as well?