From 8966715b2650685372e2e5475cd48727a4b4b7f6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 9 Nov 2009 12:44:19 +0100 Subject: [PATCH] luaa: dump backtrace on panic Signed-off-by: Julien Danjou --- luaa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/luaa.c b/luaa.c index 7c0f9c13a..71b9a9158 100644 --- a/luaa.c +++ b/luaa.c @@ -43,6 +43,7 @@ #include "selection.h" #include "common/xcursor.h" #include "common/buffer.h" +#include "common/backtrace.h" #ifdef WITH_DBUS extern const struct luaL_reg awesome_dbus_lib[]; @@ -656,8 +657,12 @@ luaA_awesome_emit_signal(lua_State *L) static int luaA_panic(lua_State *L) { - warn("unprotected error in call to Lua API (%s), restarting awesome", + warn("unprotected error in call to Lua API (%s)", lua_tostring(L, -1)); + buffer_t buf; + backtrace_get(&buf); + warn("dumping backtrace\n%s", buf.s); + warn("restarting awesome"); awesome_restart(); return 0; }