lua-users home
lua-l archive

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

* On 2006-12-10 Leo Razoumov <> wrote  :

> Hi Everyone,
> the core Lua does not provide a debugger, but according to PiL2
> (chapter 23) the Debug Library provides everything needed to roll
> one's own debugger.
> At this point I have pretty straightforward debugging needs to:
> 1: Instrument my Lua code with calls to a "break" function that breaks
> the execution at the point where it is called  and gives me Lua
> interactive session (Lua prompt)
> 2: Inspect and possibly modify Lua values (global, local, upvalues,
> etc) through the Lua interactive session
> 3: continue: end Lua interactive session and continue Lua code
> execution from where "break" call returns.
> Any suggestions on how to do this?

Will the debug.debug () not do all you need ? From the manual:

"Enters an interactive mode with the user, running each string that the
user enters. Using simple commands and other debug facilities, the user
can inspect global and local variables, change their values, evaluate
expressions, and so on. A line containing only the word cont finishes
this function, so that the caller continues its execution."