[Development] QJSEngine debuging

Koehne Kai Kai.Koehne at digia.com
Mon Nov 19 09:03:51 CET 2012



> -----Original Message-----
> From: development-bounces+kai.koehne=digia.com at qt-project.org
> [mailto:development-bounces+kai.koehne=digia.com at qt-project.org] On
> Behalf Of Michal Dorner
> Sent: Sunday, November 18, 2012 12:44 PM
> To: development at qt-project.org
> Subject: [Development] QJSEngine debuging
> 
> Hi,
> 
> i'm student at FIIT STU <http://www.fiit.stuba.sk/en.html?page_id=749>
> and my team is working on qt based server application.
> I realy like idea to make application extendable via JavaScript modules and
> probably implement some trivial core functionality in it too.
> Our plan is to switch project to qt5 and use QJSEngine  (not qml because it's
> service, not GUI).
> I was asked to anlyze debug options for it and i have found this discusion
> http://www.mail-archive.com/development@qt-project.org/msg04132.html
> 
> 	QJS has no debugging API or tools. V8 provides a public debugging
> API,
> 	but we'd have to be very careful if QJS were to wrap that (again, to
> 	avoid leaking back-end details).
> 
> 
> I wonder if it's possible to get v8 handle from QJSEngine instance and
> enable debuging using v8 api.
> Goal is to provide debuging with greakpoints and steps using Eclipse plugin
> or something like node-inspector <https://github.com/dannycoates/node-
> inspector>  in Node.js
> 
> Could someone pleas tell me if it's this possbile? Thanks.

Hi,

Even if you're not using QML, you might look into using it's debugging infrastructure. All you'll probably have to do is create a dummy QQmlEngine at the start of your app: Since breakpoints, stepping are global for v8, you should be able to debug any JS code run by your app from within Qt Creator. With a bit of work you could also implement an Eclipse backend: The debugging protocol of QML just wraps the V8 JSON one.

Drop me a mail if you need further links.

Regards

Kai
 
> Best regards,
> Michal Dorner



More information about the Development mailing list