From: John L. <jr...@us...> - 2007-06-14 23:59:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16698/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp wxlstack.cpp Log Message: Add "voidptr_long" binding tag to allow using void* as a number Speed up bindings by using numbers as keys in the registry (avoid lua doing a string copy) Get rid of wxLuaState::GetXXXTag functions, something better needs to be implemented, using global vars for the few tags that we really use often now Allow the wxLuaStackDialog to be able to show lua's registry lots of cleanup in bindings.wx.lua Index: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlstack.cpp 8 Jun 2007 01:36:32 -0000 1.4 --- wxlstack.cpp 14 Jun 2007 23:59:48 -0000 1.5 *************** *** 350,355 **** --- 350,364 ---- // If at global scope, process globals if (m_stack_sel == (int)m_stackEntries.GetCount() - 1) + { EnumerateGlobalData(m_listCtrl->GetItemCount()); + if (m_wxlState.Ok()) + { + wxLuaDebugData debugData1; + debugData1.EnumerateTable(m_wxlState, LUA_REGISTRYINDEX, -1, m_luaReferences); // Get global table + FillTableEntry(m_listCtrl->GetItemCount(), debugData1); + } + } + if (m_wxlState.Ok()) GetDerivedAndTrackedItems(); *************** *** 397,401 **** info.SetId(lc_item); - m_listCtrl->SetItem(lc_item, 1, wxString::Format(wxT("%d:%d"), level+1, n+1)); m_listCtrl->SetItem(lc_item, 2, item->GetType()); --- 406,409 ---- Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxldebug.cpp 14 Jun 2007 05:02:49 -0000 1.33 --- wxldebug.cpp 14 Jun 2007 23:59:48 -0000 1.34 *************** *** 245,253 **** int count = 0; ! if (tableRef == -1) { wxlState.GetGlobals(); int nRef = wxlState.tinsert(-1); ! Add(new wxLuaDebugItem(wxT("Globals"), wxT("Table"), wxT(""), wxT(""), nRef, 0, WXLUA_DEBUGITEM_TTABLE)); references.Add(nRef); } --- 245,267 ---- int count = 0; ! wxString type; ! wxString value; ! wxString name; ! int flag_type = WXLUA_DEBUGITEM_TUNKNOWN; ! ! if ((tableRef == -1) || (tableRef == LUA_GLOBALSINDEX)) { wxlState.GetGlobals(); + GetTypeValue(wxlState, -1, type, value, &flag_type); int nRef = wxlState.tinsert(-1); ! Add(new wxLuaDebugItem(wxT("Globals"), wxT("Table"), value, wxT(""), nRef, 0, WXLUA_DEBUGITEM_TTABLE)); ! references.Add(nRef); ! } ! else if (tableRef == LUA_REGISTRYINDEX) ! { ! wxlState.lua_PushValue(LUA_REGISTRYINDEX); ! GetTypeValue(wxlState, -1, type, value, &flag_type); ! int nRef = wxlState.tinsert(-1); ! Add(new wxLuaDebugItem(wxT("Lua Registry"), wxT("Table"), value, wxT(""), nRef, 0, WXLUA_DEBUGITEM_TTABLE)); references.Add(nRef); } *************** *** 256,263 **** if (wxlState.tget(tableRef)) { ! wxString type; ! wxString value; ! wxString name; ! int flag_type = WXLUA_DEBUGITEM_TUNKNOWN; int nTop = lua_gettop(L); --- 270,286 ---- if (wxlState.tget(tableRef)) { ! // ------------------------------ ! // if we're actually looking at the wxLuaReferences table we'd just ! // keep adding new refs, so count what we've got now and show only them. ! // This is only for debugging or curiosity. ! int is_reftable = -1; ! wxlua_pushkey_wxLuaReferences(L); ! wxlState.lua_RawGet(LUA_REGISTRYINDEX); ! ! if (wxlState.lua_Equal(-1, -2)) ! is_reftable = lua_objlen(L, -1); ! ! wxlState.lua_Pop(1); ! // ------------------------------ int nTop = lua_gettop(L); *************** *** 265,269 **** // start iterating lua_pushnil(L); ! while (lua_next(L, nTop) != 0) { // get the index, just want the name=value, type is dummy here --- 288,292 ---- // start iterating lua_pushnil(L); ! while ((lua_next(L, nTop) != 0) && ((is_reftable < 0) || (count < is_reftable))) { // get the index, just want the name=value, type is dummy here *************** *** 272,275 **** --- 295,300 ---- GetTypeValue(wxlState, -1, type, value, &flag_type); + //wxPrintf(wxT("wxLuaDebugData::EnumerateTable %d type='%s' key='%s' val='%s'\n"), count, type.c_str(), name.c_str(), value.c_str()); + int nRef = LUA_NOREF; if (lua_istable(L, -1)) |