diff options
Diffstat (limited to 'apps/plugins/lua/rocklua.c')
-rw-r--r-- | apps/plugins/lua/rocklua.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/plugins/lua/rocklua.c b/apps/plugins/lua/rocklua.c index 79f6bae953..3909f3008f 100644 --- a/apps/plugins/lua/rocklua.c +++ b/apps/plugins/lua/rocklua.c | |||
@@ -86,7 +86,7 @@ static int db_errorfb (lua_State *L) { | |||
86 | if (lua_gettop(L) == arg) | 86 | if (lua_gettop(L) == arg) |
87 | lua_pushliteral(L, ""); | 87 | lua_pushliteral(L, ""); |
88 | else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ | 88 | else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ |
89 | else lua_pushliteral(L, "\n"); | 89 | else lua_pushliteral(L, "\n\n"); |
90 | lua_pushliteral(L, "stack traceback: "); | 90 | lua_pushliteral(L, "stack traceback: "); |
91 | while (lua_getstack(L1, level++, &ar)) { | 91 | while (lua_getstack(L1, level++, &ar)) { |
92 | if (level > LEVELS1 && firstpart) { | 92 | if (level > LEVELS1 && firstpart) { |
@@ -101,7 +101,7 @@ static int db_errorfb (lua_State *L) { | |||
101 | firstpart = 0; | 101 | firstpart = 0; |
102 | continue; | 102 | continue; |
103 | } | 103 | } |
104 | lua_pushliteral(L, "\n\t"); | 104 | lua_pushliteral(L, "\n\n\t"); |
105 | lua_getinfo(L1, "Snl", &ar); | 105 | lua_getinfo(L1, "Snl", &ar); |
106 | char* filename = rb->strrchr(ar.short_src, '/'); /* remove path */ | 106 | char* filename = rb->strrchr(ar.short_src, '/'); /* remove path */ |
107 | lua_pushfstring(L, "%s:", filename ? filename : ar.short_src); | 107 | lua_pushfstring(L, "%s:", filename ? filename : ar.short_src); |
@@ -118,8 +118,10 @@ static int db_errorfb (lua_State *L) { | |||
118 | lua_pushfstring(L, " in function <%s:%d>", | 118 | lua_pushfstring(L, " in function <%s:%d>", |
119 | ar.short_src, ar.linedefined); | 119 | ar.short_src, ar.linedefined); |
120 | } | 120 | } |
121 | |||
121 | lua_concat(L, lua_gettop(L) - arg); | 122 | lua_concat(L, lua_gettop(L) - arg); |
122 | } | 123 | } |
124 | lua_pushfstring(L, "\n\nRam Used: %d Kb", lua_gc (L, LUA_GCCOUNT, 0)); | ||
123 | lua_concat(L, lua_gettop(L) - arg); | 125 | lua_concat(L, lua_gettop(L) - arg); |
124 | return 1; | 126 | return 1; |
125 | } | 127 | } |
@@ -225,6 +227,14 @@ static int lua_split_arguments(lua_State *L, const char *filename) | |||
225 | return 2; | 227 | return 2; |
226 | } | 228 | } |
227 | 229 | ||
230 | static void display_traceback(const char *errstr) | ||
231 | { | ||
232 | #if 1 | ||
233 | splash_scroller(HZ * 5, errstr); /*rockaux.c*/ | ||
234 | #else | ||
235 | rb->splash(10 * HZ, errstr); | ||
236 | #endif | ||
237 | } | ||
228 | /***************** Plugin Entry Point *****************/ | 238 | /***************** Plugin Entry Point *****************/ |
229 | enum plugin_status plugin_start(const void* parameter) | 239 | enum plugin_status plugin_start(const void* parameter) |
230 | { | 240 | { |
@@ -251,7 +261,8 @@ enum plugin_status plugin_start(const void* parameter) | |||
251 | 261 | ||
252 | if (lu_status) { | 262 | if (lu_status) { |
253 | DEBUGF("%s\n", lua_tostring(Ls, -1)); | 263 | DEBUGF("%s\n", lua_tostring(Ls, -1)); |
254 | rb->splash(10 * HZ, lua_tostring(Ls, -1)); | 264 | display_traceback(lua_tostring(Ls, -1)); |
265 | //rb->splash(10 * HZ, lua_tostring(Ls, -1)); | ||
255 | /*lua_pop(Ls, 1);*/ | 266 | /*lua_pop(Ls, 1);*/ |
256 | } | 267 | } |
257 | lua_close(Ls); | 268 | lua_close(Ls); |