lua-users home
lua-l archive

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


On Fri, 2010-09-03 at 20:26 +0200, Patrick Rapin wrote:
> 
>         BTW, you told me about debugging Lua...  There are some IDEs
>         out there
>         that can debug Lua code, but is there any standalone
>         application (like
>         gdb for C/C++) that does that?  What about debugging
>         techniques?  I'm
>         already looking for it in my favorite search engine,
>         thanks :-)
>         
>         
> 
> If by standalone application you mean a software piece able to debug
> any Lua 
> code embedded in any C program, I would suggest Decoda. This debugger
> unfortunately only runs on Windows and is a shareware, but it is very
> powerful.
> It automatically places hidden breakpoints on Lua API functions (using
> either
> the dynamic library entry points or the PDB symbol file), so that it
> can trace
> every Lua activity. You can then for example place a breakpoint on a
> code
> snippet loaded with luaL_loadstring().

I am currently working on something similar, however, currently I am at
a very early stage. Currently I have modified the Lua interpreter,
providing hooks at some interesting places (like after compiling a
chunk, after executing an instruction...), with UI that can be written
separately - I use TCP communication between the debugger UI and the Lua
process. If everything goes well, it should be able to debug embedded
Lua inside a program (provided it uses Lua shared library).

I plan to opensource it, however, currently everything is at a very
early stage (and the protocol between the UI and debugger is not stable
yet) - I am still learning about the Lua internals...