[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua debugging: how to break, enter Lua interactive session, continue?
- From: lua@...
- Date: Sun, 10 Dec 2006 16:02:17 +0100
* On 2006-12-10 Leo Razoumov <slonik.az@gmail.com> 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."
--
:wq
^X^Cy^K^X^C^C^C^C