[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Debugging coroutines question
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Mon, 26 Sep 2005 16:35:04 -0300
On 9/24/05, Terisquas Brothers <email@example.com> wrote:
> I'm trying to write a debugger for lua using tcp/ip ,
> and it seems that after some work it starts running :)
May I plug RemDebug (http://www.keplerproject.org/remdebug)? It looks
just like you are doing.
> I have a problem though, I have most of my functions
> in coroutines, plus a dispatcher function which is
> called each game frame. The problem is that if I put a
> breakpoint on a coroutine (the lua program is executed
> under LUA_HOOKLINE and LUA_HOOKCALL so that every line
> should come to my debug hook) it will never reach it,
> and I'm absolutely sure the code it's being executed.
> It seems like the LUA_HOOKLINE doesn't "break" once
> coroutine.resume is called. I've been looking at my
> code but I can't find any reason which could produce
> this behaviour. Is it a known issue/limitation or it's
> a fault of mine?
This is because hooks are specific to a lua_State, and a coroutine has
its own lua_State. You have to set the hook in the coroutine you are
> I'm using lua 5.0.2.