Update of /cvsroot/wxlua/wxLua/modules/wxlua/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11048/wxLua/modules/wxlua/src
Modified Files:
wxlbind.cpp wxlintrp.cpp wxlstate.cpp
Log Message:
remove debug msgdlgs in editor
add some debugging to diagnose coroutine ttag problem, no luck so far
Index: wxlstate.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** wxlstate.cpp 12 Dec 2005 05:16:32 -0000 1.13
--- wxlstate.cpp 16 Dec 2005 05:12:26 -0000 1.14
***************
*** 1015,1021 ****
--- 1015,1024 ----
lua_State* L = M_WXLSTATEDATA->m_lua_State;
+ wxPrintf(wxT("wxLuaState::ttag %d"), index);
+
int tag = TLUA_NOTAG;
if (lua_getmetatable(L, index) != 0)
{
+ wxPrintf(wxT(" has metatable"));
lua_pushliteral(L, "tag");
lua_rawget(L, -2);
***************
*** 1023,1029 ****
--- 1026,1034 ----
{
tag = (int) lua_tonumber(L, -1);
+ wxPrintf(wxT(" and is number %d"), tag);
}
lua_pop(L, 2);
}
+ wxPrintf(wxT("\n"));
return tag;
}
Index: wxlbind.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** wxlbind.cpp 12 Dec 2005 05:16:32 -0000 1.8
--- wxlbind.cpp 16 Dec 2005 05:12:26 -0000 1.9
***************
*** 82,85 ****
--- 82,90 ----
const char *cpIndex = "{unknown}";
+ bool init_isuserdata = lua_isuserdata(L, 1);
+ bool init_islightuserdata = lua_islightuserdata(L, 1);
+ int init_ttag = wxlState.ttag(1);
+ int init_class_tag = pClass ? *pClass->class_tag : -1;
+
if ((pClass != NULL) && lua_isuserdata(L, 1) &&
(lua_islightuserdata(L, 1) == 0) &&
***************
*** 127,130 ****
--- 132,138 ----
}
+ wxPrintf(wxT("wxLua_lua_getTableFunc '%s' pClass %d, userdata %d, lightuserdata %d, ttag %d, class_tag %d lua_State %d wxLuaStateRefData %d\n"),
+ lua2wx(cpIndex).c_str(), (long)pClass, init_isuserdata, init_islightuserdata, init_ttag, init_class_tag, (long)L, (long)wxlState.GetRefData());
+
if (!fFound)
wxlState.terror(wx2lua(wxString::Format(_("wxLua: Attempt to call an invalid method '%s'."), lua2wx(cpIndex).c_str())));
Index: wxlintrp.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlintrp.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** wxlintrp.cpp 15 Dec 2005 21:45:21 -0000 1.8
--- wxlintrp.cpp 16 Dec 2005 05:12:26 -0000 1.9
***************
*** 67,78 ****
// set the value
lua_settable( L1, LUA_REGISTRYINDEX );
!
wxLuaInterpreter *L_interp = wxFindLuaInterpreter(L);
! //printf("Adding new lua_State from a thread L=%ld L1=%ld\n", (long)L, (long)L1); fflush(stdout);
if (L_interp != NULL)
{
s_wxHashMapLuaInterpreter[L1] = L_interp;
!
// Stick us into the lua interpreter - push key, value
lua_pushstring( L1, "__wxLuaInterpreter" );
--- 67,78 ----
// set the value
lua_settable( L1, LUA_REGISTRYINDEX );
!
wxLuaInterpreter *L_interp = wxFindLuaInterpreter(L);
! wxPrintf(wxT("wxLuaInterpreter_newthread_handler new lua_State from a thread L=%ld L1=%ld\n"), (long)L, (long)L1);
if (L_interp != NULL)
{
s_wxHashMapLuaInterpreter[L1] = L_interp;
!
// Stick us into the lua interpreter - push key, value
lua_pushstring( L1, "__wxLuaInterpreter" );
***************
*** 88,92 ****
{
// L is the original lua_State, L1 child thread, don't remove L
! //printf("Freeing lua_State from a thread L=%ld L1=%ld\n", (long)L, (long)L1); fflush(stdout);
wxLuaStateRefData::s_wxHashMapLuaStateRefData.erase(L1);
s_wxHashMapLuaInterpreter.erase(L1);
--- 88,92 ----
{
// L is the original lua_State, L1 child thread, don't remove L
! //wxPrintf(wxT("wxLuaInterpreter_freethread_handler lua_State from a thread L=%ld L1=%ld\n"), (long)L, (long)L1); fflush(stdout);
wxLuaStateRefData::s_wxHashMapLuaStateRefData.erase(L1);
s_wxHashMapLuaInterpreter.erase(L1);
|