Lua Debugging?
2 posters
Lua Debugging?
I've run through Tutorial 10 and attached a very simple Lua script to a SIO2 project. However, it keeps crashing when I run it in the simulator. What's the suggested method of debugging the lua script? Cutting out part of the script till you find the problem line seems inherently tedious and there has to be a better way, especially since I currently only have one critical line.
If interested, it fails at this line in ldo.c:
status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
All I'm doing is reusing 10's example, cutting render down to (I'll be using the vector for a calculation if I get it to run):
function Cube.render()
Cube.vec = Cube.obj._SIO2transform.rot;
end
If interested, it fails at this line in ldo.c:
status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
All I'm doing is reusing 10's example, cutting render down to (I'll be using the vector for a calculation if I get it to run):
function Cube.render()
Cube.vec = Cube.obj._SIO2transform.rot;
end
BenSS- Posts : 2
Join date : 2009-06-11
Re: Lua Debugging?
Hi, lots of empathy for you... I wound up using good old printf's! Lua does log errors to the console but it was hard to interpret parsing errors versus logic errors. I wound up using the on-line Lua engine for some syntax checking:
http://www.lua.org/demo.html
And you might want to try something like Ldb:
http://www.tecgraf.puc-rio.br/~tomas/ldb/
--yarri
PS: I posted my Lua steering port to this forum, my code works on both sim and device so it might give you another reference point in addition to the tutorial
http://www.lua.org/demo.html
And you might want to try something like Ldb:
http://www.tecgraf.puc-rio.br/~tomas/ldb/
--yarri
PS: I posted my Lua steering port to this forum, my code works on both sim and device so it might give you another reference point in addition to the tutorial
yarri- Posts : 81
Join date : 2009-04-10
Re: Lua Debugging?
Thanks, that helps at least but it's tedious sometimes getting it to work. Feels very old-school!
Currently trying to figure out why adding any lua script to my current project crashes it now, even tried one with only comments!
Currently trying to figure out why adding any lua script to my current project crashes it now, even tried one with only comments!
BenSS- Posts : 2
Join date : 2009-06-11
Permissions in this forum:
You cannot reply to topics in this forum