Kent
Labs
Qt Script Debug
Posted by Kent
 in Labs, Qt Script Debug
 on Friday, February 22, 2008 @ 10:19

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. :-D

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”

» Posted by Richard Moore
 on Friday, February 22, 2008 @ 11:07

Sounds neat Kent, where can we find the code?

» Reply from Kent
 on Friday, February 22, 2008 @ 12:17
Kent

@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

» Posted by Richard Moore
 on Friday, February 22, 2008 @ 12:56

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.

» Posted by Zandru
 on Friday, February 22, 2008 @ 13:42

fantastic news! i can’t wait for 4.4 to be released! :D

» Posted by Marius
 on Sunday, February 24, 2008 @ 07:51

@Richard: It shows up nicely in my Explorer. Which version are you using?

» Posted by Richard Moore
 on Monday, February 25, 2008 @ 17:40

@Marius I used IE 6

» Posted by Wolfgang
 on Wednesday, February 27, 2008 @ 09:51

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?