No-Humbug-Debugging With Qt Script Debug

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!


Blog Topics:

Comments