Murga-Projects Forums

Full Version: debugger for MurgaLua?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been playing around with SciteDebug lately and I'm quite happy with it, because it just extends my favorite text editor under Windows and Linux with debugging features for my favorite language Lua. Together they make a very fine lightweight IDE which perfectly fits to MurgaLua, apart from one little point: for some unknown reason the inegrated cli debugger does not work together with MurgaLua, I was only able debugging using a vanilla Lua 5.1.x .

So I would like to ask the other MurgaLua users, do you use a debugger? Which one can you recommend? Are there any plans to integrate something like cli debugger into MurgaLua?

Thanks and regards,
I expect the other software is coded to run vanilla lua only,
and it runs the script against that.
Is vanilla lua on your system or part of the software?

If its on your system, delete, rename a copy of murgaLua to lua5.x.x whatever,
and fool the software. That should work....

I suppose reading Chapter 23: The Debug Library
would help to run your script in murgaLua and get debug values as results.

I'm just running and crashing in terminal and iGame3D, checking the console logs alot.

Maybe I should read Chapter 23...

EDIT -- This might be a BUG
Lua works with the example function in Chapter 23.
Murgalua returns

stdin:4: attempt to index global 'debug' (a function value)

debug.getinfo() is working outside of functions in murgaLua, but you
get that error if its inside a function. I first found out with this:

function dbug()
Fun = print
Bug = debug.getinfo(Fun)
for i,v in pairs(Bug) do print(i,v) end

Hi iGame3d,

by "vanilla" I mean a pure Lua without any "murgaesque" extensions as you can obtain from the website. I'm aware of Lua's built-in debug library, but for using it directly as debugger I would consider it way too cumbersome. Or to cite Chapter 23, "The debug library does not give you a debugger for Lua, but it offers all the primitives that you need for writing a debugger for Lua."
You are right, for getting better insights into my problems to get MurgaLua working with sciteDebug, a test of the debugger library in MurgaLua would be a good step to narrow down the possible causes.
While I started myself using print statements directly in the code for debugging as well, I've become a very big fan of regular debuggers lately and would consider their availability as a key must-have feature for a truly productive development platform. I'm not sure if it's realistic, but I would be very delighted if it would be possible to integrate a lightweight debugger such as clidebugger directly into murgaLua and provide something like a debug mode which would allow you to inspect the program flow, variable values, and the call stack immediately during runtime.
If I come up with a good idea, I'll post it here.
I've put it on my todo for the release after next ...
I've taken now a closer look at clidebugger under MurgaLua, and it works fine as command line debugger. We can now be pretty sure that there is nothing wrong with MurgaLua's inclusion of Lua's standard debug library (which is called internally by clidebugger).

This means that pure clidebugger already provides all the features I wanted to have in my last post out of the box. The only disadvantage is its minimalistic command line interaction. So I get really tempted to write a little UI for it in MurgaLua itself.

Let's see...
Reference URL's