FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Lua Debugging?

2 posters

Go down

Lua Debugging? Empty Lua Debugging?

Post  BenSS Thu Jun 11, 2009 1:43 pm

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

BenSS

Posts : 2
Join date : 2009-06-11

Back to top Go down

Lua Debugging? Empty Re: Lua Debugging?

Post  yarri Fri Jun 12, 2009 11:40 am

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

yarri

Posts : 81
Join date : 2009-04-10

Back to top Go down

Lua Debugging? Empty Re: Lua Debugging?

Post  BenSS Thu Jun 18, 2009 1:35 pm

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!

BenSS

Posts : 2
Join date : 2009-06-11

Back to top Go down

Lua Debugging? Empty Re: Lua Debugging?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum