Exemple #1
0
static void dohook (int ref) {
  lua_LHFunction oldlinehook = lua_setlinehook(NULL);
  lua_CHFunction oldcallhook = lua_setcallhook(NULL);
  lua_callfunction(lua_getref(ref));
  lua_setlinehook(oldlinehook);
  lua_setcallhook(oldcallhook);
}
Exemple #2
0
static void setlinehook (void) {
  lua_Object f = lua_getparam(1);
  lua_unref(linehook);
  if (f == LUA_NOOBJECT) {
    linehook = -1;
    lua_setlinehook(NULL);
  }
  else {
    lua_pushobject(f);
    linehook = lua_ref(1);
    lua_setlinehook(linef);
  }
}
Exemple #3
0
static void laction (int i) {
  (void)i;  /* to avoid warnings */
  signal(SIGINT, SIG_DFL); /* if another SIGINT happens before lstop,
                              terminate process (default action) */
  old_linehook = lua_setlinehook(L, (lua_Hook)lstop);
  old_callhook = lua_setcallhook(L, (lua_Hook)lstop);
}
Exemple #4
0
static void laction (int i) {
    signal(SIGINT, SIG_DFL); /* if another SIGINT happens before lstop,
                              terminate process (default action) */
    old_linehook = lua_setlinehook((lua_LHFunction)lstop);
    old_callhook = lua_setcallhook((lua_CHFunction)lstop);
}
Exemple #5
0
static void lstop (void) {
    lua_setlinehook(old_linehook);
    lua_setcallhook(old_callhook);
    lreset();
    lua_error("interrupted!");
}
static void lstop (lua_State *lua_state, lua_Debug *ar) {
  lua_setlinehook(lua_state, old_linehook);
  lua_setcallhook(lua_state, old_callhook);
  lreset();
  make_lua_error(lua_state, "interrupted!");
}
Exemple #7
0
void stop_trace(void)
{
 lua_setlinehook(L,NULL);
 lua_setcallhook(L,NULL);
 fclose(LOG);
}
Exemple #8
0
void start_trace(FILE* logfile)
{
 lua_setlinehook(L,linehook);
 lua_setcallhook(L,callhook);
 LOG=logfile;
}