From 31cd35f97af9f099d0474106fe1382539d98537b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 15 Feb 2015 12:24:13 +0100 Subject: [PATCH] Add debug messages for emitted signals TODO: gives "(null)" for objname. --- common/luaobject.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/luaobject.c b/common/luaobject.c index acd4bdee4..64d8face6 100644 --- a/common/luaobject.c +++ b/common/luaobject.c @@ -242,6 +242,7 @@ signal_object_emit(lua_State *L, signal_array_t *arr, const char *name, int narg foreach(func, sigfound->sigfuncs) luaA_object_push(L, *func); + debug("Emitting class signal '%s' (%d funcs)", name, nbfunc); for(int i = 0; i < nbfunc; i++) { /* push all args */ @@ -285,6 +286,10 @@ luaA_object_emit_signal(lua_State *L, int oud, { int nbfunc = sigfound->sigfuncs.len; luaL_checkstack(L, nbfunc + nargs + 2, "too much signal"); + + const char *objname = lua_tostring(L, oud_abs); + debug("Emitting signal '%s' on %s (%d funcs)", name, objname, nbfunc); + /* Push all functions and then execute, because this list can change * while executing funcs. */ foreach(func, sigfound->sigfuncs)