lua-users home
lua-l archive

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




On Tue, May 1, 2018 at 8:43 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
Am I describing your module, or close?

1. It provides interactive debugging.
2. It takes max 5 minutes of studying the README to get up to speed.
3. You run your Lua code with `lua -l mydebug` or the like.
4. At some point in the program where you need debugging, you put
    mydebug().
5. That routine calls a REPL which can list, inspect and change
variables visible at that point of the program and return.

Example:

!> x?
upvalue, table 0x34bc80, has __index chain (3 levels)
!> x.a?
in __index(1), number, -nan
!> x.a = 0
!> exit

This is not a sneaky advertisement for a module I already almost have.
I wish to know what is on the shelf already.

There was a message on Lua-l from Gunnar last June about a CLI interface for mobdebug. I've used it successfully a few times. From his [ANN]: 

Hi,

this message is to announce the availability of debug.lua 0.10.
debug.lua is a terminal based standalone frontend for mobdebug,
that runs on Linux and MacOS X and probably other Unixen. Because
it is terminal based, it is navigated only with the keyboard, but it
does feature source navigation and a display for expressions that
change as you step through the source.

New in version 0.11:

* added simple config files to change the colors used by debug.lua
* fixed a bug where the output of the '=' command was getting formatted
  on a weird (and also wrong) way

You can get debug.lua from http://www.tset.de/debug.lua

or via luarocks install debug.lua.

Rgds,

Gunnar