Working on a Debugger for Gjs



Hi all,

I just wanted to give everyone a heads up that I'm looking into
mplementing an interactive console-based debugger for Gjs based on the
new JS Debugger API in SpiderMonkey [1]. This should be relatively
self-contained work, but I might end up sharing some of the code with
the "coverage mode" I implemented last year.

I'm not too sure how much I can say about the general architecture of
what it will look like internally without also providing code and
tests, which I'm not ready to do yet. Effectively there will be a
switch that you can pass to gjs which puts it into a "debugger" mode
and you'll get a readline-like console with a command tree similar to
what you get in something like gdb.

The planned goals are to allow for the setting and removal of
breakpoints, interrupting the program and providing a stack trace,
catching exceptions, evaluation of arbitrary expression etc.
Potentially we might also expose this as part of libgjs so tools like
gjs-inspector[2] can use it too.

I hope to have some RFC-style patches and tests up on bugzilla in the
next few days for the very basic groundwork to see if I'm taking the
right direction - from there it should be a matter of just
implementing what's already made available to us by SpiderMonkey.

Cheers,

Sam.

[1] https://developer.mozilla.org/en-US/docs/Tools/Debugger-API
[2] https://github.com/alexlarsson/gjs-inspector

-- 
Sam Spilsbury


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]