lua-users home
lua-l archive

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



Hi List,
    I've been working on building a run time debugger into my simulation system, I'm wondering should the following work:
    debug.sethook (_coroutine, step_line, "l");
    debug.sethook (_coroutine, step_function, "c");

As far as I can tell from walking through the vm code registering "c" blows away the "l" function. It seems like this behavior should be documented somewhere, I'm wondering what the implications of this might mean to debugging multiple threads

I would think if multiple hooks worked that:
    L->hookmask = cast_byte(mask);
  should be more elaborate ie |= to turn on  or &= ~ to turn off.

LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
  if (func == NULL || mask == 0) {  /* turn off hooks? */
    mask = 0;
    func = NULL;
  }
  L->hook = func;
  L->basehookcount = count;
  resethookcount(L);
  L->hookmask = cast_byte(mask);
  return 1;
}

Thanks for any insight
-Gedalia
--
---------------------------------------------------------------
AIM: gedaliap
http://www.gedalia.net
---------------------------------------------------------------
Fight Entropy!!!  Fight Entropy!!!  Figth Etnropy! !
iFgth Etnrop!y ! giFth tErno!py !  giFt htrEno!p y! --- Well maybe
not...