summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2007-05-22 08:46:59 +0000
committerpixel <pixel>2007-05-22 08:46:59 +0000
commit35294ec19264e0b90ff4cb98aedf7ed438aa3333 (patch)
tree8ef31f7c6f6ed58f89b8cc9fffd6410e925fa6cc /lib
parent6938bdc415e924b7ef404e4ed1781ae782bfa0c0 (diff)
Adding showstack() method.
Diffstat (limited to 'lib')
-rw-r--r--lib/BLua.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc
index 3f7df94..799d54e 100644
--- a/lib/BLua.cc
+++ b/lib/BLua.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: BLua.cc,v 1.40 2007-04-11 00:16:30 pixel Exp $ */
+/* $Id: BLua.cc,v 1.41 2007-05-22 08:46:59 pixel Exp $ */
#include <stdlib.h>
#include "BLua.h"
@@ -1035,15 +1035,13 @@ Lua * Lua::find(lua_State * __L) throw (GeneralException) {
return i->second;
}
-void Lua::showerror() {
+void Lua::showstack(int level) {
int n = lua_gettop(L);
int i;
String t;
- printm(M_ERROR, "Lua object: Got an LUA error, inspecting stack.\n");
-
if (n == 0) {
- printm(M_ERROR, "Stack empty\n");
+ printm(level, "Stack empty\n");
return;
}
@@ -1074,10 +1072,16 @@ void Lua::showerror() {
t = "Unknown";
}
- printm(M_ERROR, String(i) + ": " + t + "\n");
+ printm(level, String(i) + ": " + t + "\n");
}
}
+void Lua::showerror() {
+ printm(M_ERROR, "Lua object: Got an LUA error, inspecting stack.\n");
+
+ showstack(M_ERROR);
+}
+
int Lua::getmetatable(int i) {
return lua_getmetatable(L, i);
}