lua-users home
lua-l archive

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


This is something that may be useful; I've done a SciTE extension
which spawns various debuggers like gdb and remDebug and allows
breakpoints to be set, variables to be inspected, etc. It is still
pretty basic but is good enough for your homework. SciTE is a
capable,popular, free, slim editor which works well on Windows and GTK
platforms like Linux. It is fully scriptable with Lua 5.1, and the
debug framework is all in Lua, except for a smallish C extension
needed to extend SciTE's abilty to spawn interactive programs.

Scite-debug uses remDebug (thanks to its authors!) for its Lua
debugging engine; a somewhat modified version accompanies the code.
remDebug requires lfs and luasocket, but the pay-off is that you can
debug embedded Lua scripts in other applications or running as CGI
scripts. The code is all there; it should be pretty easy to modify
remDebug.lua in the SciTE code for one of the other Lua debuggers. (To
add a new debugger is not difficult; the most tricky part is pattern
matching the expected output.)

Since scite-debug supports gdb, you can have two instances of SciTE
debugging the C/C++ and the Lua part of your application.  Things seem
to work just as well on both Windows and Linux. Bear in mind that
remDebug has its little moments!

For the merely curious - this shows tooltip evaluation:
http://mysite.mweb.co.za/residents/sdonovan/scite/scite-debug.png

Source, with precompiled libraries:
http://mysite.mweb.co.za/residents/sdonovan/scite/scite-debug.zip

You do require the latest public SciTE snapshots, because previous
releases have not exposed the Lua symbols from the SciTE executable:

http://scintilla.sourceforge.net/wscite.zip  (Windows precompiled version)
http://scintilla.sourceforge.net/scite.zip  (Source for both platforms)

Setting up Scite-debug is straightforward but does involve editing
property files, etc. For the impatient, I've packaged the debugger
extension with the Windows snapshot binaries:
http://mysite.mweb.co.za/residents/sdonovan/scite/wscite.zip

steve d.