Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6193/wxLua/modules/wxluadebug/src
Modified Files:
wxldebug.cpp wxlstack.cpp
Log Message:
Add a lua reg table to track ALL items pushed into lua, for debugging
Index: wxlstack.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** wxlstack.cpp 19 Jun 2007 13:58:16 -0000 1.9
--- wxlstack.cpp 28 Jun 2007 22:45:57 -0000 1.10
***************
*** 111,116 ****
// -----------------------------------------------------------------------
! m_typeColours[IMG_UNKNOWN] = wxColour(wxT("TURQUOISE"));
! m_typeColours[IMG_NONE] = wxColour(wxT("TURQUOISE"));
m_typeColours[IMG_NIL] = wxColour(wxT("BLACK"));
m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK"));
--- 111,116 ----
// -----------------------------------------------------------------------
! m_typeColours[IMG_UNKNOWN] = wxColour(wxT("DARK TURQUOISE"));
! m_typeColours[IMG_NONE] = wxColour(wxT("DARK TURQUOISE"));
m_typeColours[IMG_NIL] = wxColour(wxT("BLACK"));
m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK"));
Index: wxldebug.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** wxldebug.cpp 25 Jun 2007 23:04:02 -0000 1.37
--- wxldebug.cpp 28 Jun 2007 22:45:57 -0000 1.38
***************
*** 283,286 ****
--- 283,291 ----
int nTop = lua_gettop(L);
+ wxlua_pushkey_wxLuaObjects(L);
+ lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table)
+ bool is_lreg_objTable = (lua_equal(L, -1, -2) != 0);
+ lua_pop(L, 1);
+
// start iterating
lua_pushnil(L);
***************
*** 292,295 ****
--- 297,307 ----
GetTypeValue(wxlState, -1, type, value, &flag_type);
+ if (is_lreg_objTable)
+ {
+ long tag = -1;
+ if (value.BeforeFirst(wxT(' ')).ToLong(&tag))
+ value = value.BeforeFirst(wxT(' ')) + wxT(" (") + wxlState.GetLuaTagName(tag) + wxT(")");
+ }
+
//wxPrintf(wxT("wxLuaDebugData::EnumerateTable %d type='%s' key='%s' val='%s'\n"), count, type.c_str(), name.c_str(), value.c_str());
***************
*** 458,461 ****
--- 470,475 ----
else if (udata == &wxlua_lreg_wxluastaterefdata_key)
s += wxT(" - wxLuaStateRefData");
+ else if (udata == &wxlua_lreg_objects_key)
+ s += wxT(" - wxLua Pushed Userdata");
else if (udata == &wxlua_lreg_callbaseclassfunc_key)
s += wxT(" - CallBaseClassFunc");
|