Friday, July 9, 2010

Debugger Sneak Peak

I've started working on debug support for ENSIME. The plan is launch JDB as an inferior process, send commands via stdin and then parse what comes out of stdout. Things are moving along pretty well - here's a little screencast I just made to demo the progress:

http://www.youtube.com/watch?v=v7-G6vD42z8

Emacs users will probabably be aware that Emacs already includes a general framework for managing commandline gdb-esque debuggers, called gud-mode. In fact, gud-mode already includes support for controlling an inferior jdb. It's very basic (barely functional), though, and not extensible in the ways that I required (no way to redefine the methods for mapping class->source or source ->class). Thus I decided to whip up an improved jdb-specific debugging mode in ensime-debug.el. This new mode uses the ENSIME server to accurately map source locations to classes (for setting breakpoints) and to map class names to source files (for moving the debugger mark).

1 comment:

  1. That looks already quite good. I just yesterday had the idea to write a console debugger in Scala, which drops to a Scala console at breakpoints. Though, I'm not sure if I will really do that...

    -- Johannes

    ReplyDelete