You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(60) |
Jul
(35) |
Aug
(32) |
Sep
(5) |
Oct
(5) |
Nov
(58) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(114) |
Feb
(184) |
Mar
(153) |
Apr
(90) |
May
(153) |
Jun
(59) |
Jul
(24) |
Aug
(43) |
Sep
(17) |
Oct
(34) |
Nov
(11) |
Dec
(204) |
2007 |
Jan
(84) |
Feb
(119) |
Mar
(38) |
Apr
(28) |
May
(52) |
Jun
(105) |
Jul
(64) |
Aug
(67) |
Sep
(14) |
Oct
(3) |
Nov
(28) |
Dec
(55) |
2008 |
Jan
(228) |
Feb
(55) |
Mar
(30) |
Apr
(30) |
May
(15) |
Jun
(20) |
Jul
(12) |
Aug
(3) |
Sep
(13) |
Oct
(54) |
Nov
(35) |
Dec
(35) |
2009 |
Jan
(19) |
Feb
(20) |
Mar
(34) |
Apr
(4) |
May
(60) |
Jun
(25) |
Jul
(16) |
Aug
(51) |
Sep
(19) |
Oct
(62) |
Nov
(21) |
Dec
(12) |
2010 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(23) |
Jun
(13) |
Jul
(1) |
Aug
(40) |
Sep
(18) |
Oct
(21) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(17) |
Feb
(23) |
Mar
(1) |
Apr
(10) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(43) |
2012 |
Jan
(5) |
Feb
(19) |
Mar
(6) |
Apr
(24) |
May
(39) |
Jun
(83) |
Jul
(29) |
Aug
(36) |
Sep
(64) |
Oct
(55) |
Nov
(12) |
Dec
(7) |
2013 |
Jan
(17) |
Feb
(10) |
Mar
(37) |
Apr
(27) |
May
(13) |
Jun
(9) |
Jul
(7) |
Aug
(61) |
Sep
(23) |
Oct
(23) |
Nov
(30) |
Dec
(16) |
2014 |
Jan
(23) |
Feb
(13) |
Mar
(9) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(9) |
Oct
(24) |
Nov
(2) |
Dec
(14) |
2015 |
Jan
(6) |
Feb
(4) |
Mar
(17) |
Apr
|
May
(7) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(21) |
Nov
(6) |
Dec
(2) |
2016 |
Jan
(4) |
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(11) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: klaas.holwerda <kho...@xs...> - 2005-12-29 17:36:36
|
John Labenski wrote: >On 12/29/05, klaas.holwerda <kho...@xs...> wrote: > > >This is a problem, we need to somehow unwind the stack better. The >facilities exist, but sometimes it just errors out some trivial thing >with absolutely no reference to the line number. It'll take some >digging into the lua_Debug code. > > Ha, you are talking about a lua script i think. My problem is the lua C code. I can not debug into that code. Is it generated without debug info?? >The "namespace" is a table where the contents of it are set by >bindings. > > Found it. What should happen if one calls a non existing function on a name space? > >You should use wxEVT_LUA_ERROR. Set an event handler for the >wxLuaState to get these messages. > > Oke, will dig into this soon. >I don't understand when you say the "next two become active"? Next two of what? > > By the next two i mean that wxart2d_BindingInit s_wxart2d_BindingInit; is seen suddenly and therefore the call to this from its construtor. m_binding.GetBindingList()->Append(&m_binding); And thus the bindings are initialized properly. Without any reference to the binding library in my exe/program code, the whole binding library is skipped. > >What about, wxModule? I'll look into that this afternoon. If I >remember correctly it does something very similar to gather up all the >derived wxModule classes. > I am not so sure about this, at least i had to do trick to make sure one module was intialized before the other. Still it works oke. wxModule is realy meant to intialize things before the wxApp is starting. I think it could help us. > I don't have any problems using this >mechanism in gcc in Linux, but I have yet to try to add my own >bindings with msvc. > > wxModule is not so much for static things, but it may solve adding bindings before wxLuaState is used. >Can you reverse the order of linking the .o object files for your >program and the libraries? > > No CMake solves/writes all the makefiles for me. Thanks! Klaas |
From: John L. <jla...@gm...> - 2005-12-29 17:07:58
|
On 12/29/05, klaas.holwerda <kho...@xs...> wrote: > Hi John, > > I got something working now, but still do not understand why i can not > debug into lua code itself. This is a problem, we need to somehow unwind the stack better. The facilities exist, but sometimes it just errors out some trivial thing with absolutely no reference to the line number. It'll take some digging into the lua_Debug code. > The problem with my script was, that > wx.a2dLuaWP:Message("blah blah") should be > wxart2d.a2dLuaWP:Message("blah blah") > Which has to do with the namespace. What is lua doing with the namespace > in front? Is it a function too? The "namespace" is a table where the contents of it are set by bindings. I think (untested though) that you can jam other bindings into the wx. namespace by just setting the namespace in the binding "rules" file, but it may take some fiddling. I think that currently there are some class name clashes that will occur, but nothing that cannot be fixed. > But now the question is, how does lua feedback to me what is wrong with > my script? > Can you tell me what i should do to get some kind of feedback when my > script is not right? You should use wxEVT_LUA_ERROR. Set an event handler for the wxLuaState to get these messages. See the other events in what's left of wxlinterp.h, soon to be removed. If you have the need for not having an event handler, but would rather override a virtual function, we could add virtual handlers in the wxLuaStateRefData (cannot be done in the wxLuaState since it's recreated as necessary, eg. it's the only ref data that actually exists throughout the life of the lua_State) that would use the events by default. > I did define LuaHandler derived from wxLuaHandler, but nothing in there > is called, i expected DisplayError() would do the trick, but it seems > more is needed. See the events in the wxlua app or better yet, for the wxluaeditor app. The wxLuaHandler is really for the socket mechanism, I'm not convinced it's necessary. It was added to remove the previous wxApp dependence on the socket code and is a middle man of sorts. > On the static bindings i found the next. > If i define in MyApp as i explained the binding: > > class MyApp > { > static wxart2d_binding m_wxart2dluab; > } > > And initialize the static instance like this: > > wxart2d_binding MyApp::m_wxart2dluab; > > BUT NOT call m_binding.GetBindingList()->Append(&m_binding); > Suddenly the next two become active, i can but a break point on the > last, and it stops. I don't understand when you say the "next two become active"? Next two of w= hat? > class wxart2d_BindingInit > { > public: > wxart2d_BindingInit() > { > m_binding.GetBindingList()->Append(&m_binding); > } > wxart2d_Binding m_binding; > }; > > wxart2d_BindingInit s_wxart2d_BindingInit; > > i conclude from this, that linking somehow only includes the > classes/libraries which are really used in the code/main program/exe. If > not used from there, it is not linked in and the static > wxart2d_BindingInit is also not called. And since my bindings for > wxArt2D are in a seperate library called luawraps, my main program did > not contain anything from that. > I think this in fact makes sence, why would one link anything from a > library which is not used. > (well it only looks like it is not used, since it is only used from > scripts ) What about, wxModule? I'll look into that this afternoon. If I remember correctly it does something very similar to gather up all the derived wxModule classes. I don't have any problems using this mechanism in gcc in Linux, but I have yet to try to add my own bindings with msvc. > So why is the initialization order not a problem in this case? Just > Luck, they are initialized in the right order. > But as soon if i take class wxart2d_BindingInit from my luawraps library > and but it into my program , it is wrong again. All static stuff in the > program is done first and next what is in the libraries, and it should > be the other way around. Can you reverse the order of linking the .o object files for your program and the libraries? Regards, John Labenski |
From: klaas.holwerda <kho...@xs...> - 2005-12-29 16:25:17
|
Hi John, I got something working now, but still do not understand why i can not debug into lua code itself. The problem with my script was, that wx.a2dLuaWP:Message("blah blah") should be wxart2d.a2dLuaWP:Message("blah blah") Which has to do with the namespace. What is lua doing with the namespace in front? Is it a function too? But now the question is, how does lua feedback to me what is wrong with my script? Can you tell me what i should do to get some kind of feedback when my script is not right? I did define LuaHandler derived from wxLuaHandler, but nothing in there is called, i expected DisplayError() would do the trick, but it seems more is needed. On the static bindings i found the next. If i define in MyApp as i explained the binding: class MyApp { static wxart2d_binding m_wxart2dluab; } And initialize the static instance like this: wxart2d_binding MyApp::m_wxart2dluab; BUT NOT call m_binding.GetBindingList()->Append(&m_binding); Suddenly the next two become active, i can but a break point on the last, and it stops. class wxart2d_BindingInit { public: wxart2d_BindingInit() { m_binding.GetBindingList()->Append(&m_binding); } wxart2d_Binding m_binding; }; wxart2d_BindingInit s_wxart2d_BindingInit; i conclude from this, that linking somehow only includes the classes/libraries which are really used in the code/main program/exe. If not used from there, it is not linked in and the static wxart2d_BindingInit is also not called. And since my bindings for wxArt2D are in a seperate library called luawraps, my main program did not contain anything from that. I think this in fact makes sence, why would one link anything from a library which is not used. (well it only looks like it is not used, since it is only used from scripts ) So why is the initialization order not a problem in this case? Just Luck, they are initialized in the right order. But as soon if i take class wxart2d_BindingInit from my luawraps library and but it into my program , it is wrong again. All static stuff in the program is done first and next what is in the libraries, and it should be the other way around. I do not see the solution yet, but at least the problem is more clear :-) Regards, Klaas |
From: klaas.holwerda <kho...@xs...> - 2005-12-29 14:28:08
|
Hi John, First would you think it is possible to debug into lapi.c using VC IDE? As soon as i arrive in this code breakpoint do not work, and my program is stuck. I have my bindings added as below, but i can't get it to work. Meaning wxLuaState::RunFile() gets stuck in wxLuaState::LuaDoFile() at the lua_pcall statement. And i can not go into it. This is also the case in wxLua itself, i don't understand why. e.g. I have the next aaaa.lua file, the first statement works, it shows the message box. But for the rest nothing is done, the functions in my binding are not called. wx.wxMessageBox( 'This is the "About" dialog of the Scribble wxLua Sample.', "About wxLua", wx.wxOK + wx.wxICON_INFORMATION ) wx.a2dLuaWP:Message("blah blah") wx.a2dLuaWP:FileOpen("../drawings/polygons.cvg") How does one check if binding work somehow, or where and for what reason it is not done? Can you give me a handy breakpoint, to see what is going on? John Labenski wrote: >Can you not do this at all, because it is in a library? I thought this >would be a clever trick to ensure that all the bindings were >initialized and made available at runtime. This way you do not have to >know the name of anything and so we can even remove the dependence on >the wxWidgets binding. > > I understand it, and i think it should be possible. (it is already happening from the wxlua libs itself, so why not mine. But the order of initialization is a problem still, even if it would work. Depend on initialization order is a bit risky. I have here simular modules, and i use derived wxModule classes to make sure everything get properly initialized. Even there the order is not always clear, but for that i set a flag in lower order modules and call them in higher module initalizations , so in the end the order is fine. >What would be an alternative? > Maybe wxModule like initialization? >One way would be to make the user add >any bindings they want to a static member of wxLuaBinding themselves >in the wxApp::OnInit. > That is what i do now. I make the binding a static member of MyApp. class MyApp { static wxart2d_binding m_wxart2dluab; } wxart2d_binding MyApp::m_wxart2dluab; and in onInit() m_wxart2dluab.GetBindingList()->Append( &m_wxart2dlaub); >The only reason to have the static member is so >that they don't have to always add the bindings everytime they create >a new wxLuaState, but by default it will try to load the ones set to >the static wxList of them. > > I see in wxLuaStateRefDate that those static wxLuaBinding::GetBindingList() is added to the real/actual bindings of the wxLuaState. I assume that is what you are saying. Regards, Klaas > > > > > > |
From: John L. <jla...@gm...> - 2005-12-28 22:04:35
|
> Do not forget to modify apps.dsw ( somewhere in bakefiles ) to add that > option. Fixed (if I understand bakefile correctly), I'm recompiling it now and so far so good. > And you are right about static initialization, trhis is a problem, > having the following bindings: > > class wxart2d_BindingInit > { > public: > wxart2d_BindingInit() > { > m_binding.GetBindingList()->Append(&m_binding); > } > wxart2d_Binding m_binding; > }; > > wxart2d_BindingInit s_wxart2d_BindingInit; > > This last static instance is not called. ( it is inside a libary here ). > If i move to my main program, it is called, but to early because the next > wxLuaBindingList wxLuaBinding::sm_bindings is not yet initialized. Can you not do this at all, because it is in a library? I thought this would be a clever trick to ensure that all the bindings were initialized and made available at runtime. This way you do not have to know the name of anything and so we can even remove the dependence on the wxWidgets binding. What would be an alternative? One way would be to make the user add any bindings they want to a static member of wxLuaBinding themselves in the wxApp::OnInit. The only reason to have the static member is so that they don't have to always add the bindings everytime they create a new wxLuaState, but by default it will try to load the ones set to the static wxList of them. > First i don't understand why it is not called when it is part of my > luawraps library. > ( the library is linked, and i can a wxart2d_Binding dummy in my main, > so it is there ). > Next i don't know how to change the order of initialization of static > objects. I thought they are "run" in the order that they're linked. Or in the cases of some compilers, the reverse order that they appear on the linking command line. > I will ask Michael now, maybe he knows a solution, Hopefully. -John Labenski > John Labenski wrote: > > >>>No back to wxArt2D to see if it is the same there ;-) > >>> > >>> > >>> > >>just added the same switch, and now it is oke. > >> > >> > > > >Thats good, I have no idea how to fix static initialization problems > >elegantly. I would have had use a brute force method that just rems > >out static code (and anything that depends on it) until it worked. > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Wxlua-users mailing list > Wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > |
From: klaas.holwerda <kho...@xs...> - 2005-12-28 21:13:59
|
Hi John, Do not forget to modify apps.dsw ( somewhere in bakefiles ) to add that option. And you are right about static initialization, trhis is a problem, having the following bindings: class wxart2d_BindingInit { public: wxart2d_BindingInit() { m_binding.GetBindingList()->Append(&m_binding); } wxart2d_Binding m_binding; }; wxart2d_BindingInit s_wxart2d_BindingInit; This last static instance is not called. ( it is inside a libary here ). If i move to my main program, it is called, but to early because the next wxLuaBindingList wxLuaBinding::sm_bindings is not yet initialized. First i don't understand why it is not called when it is part of my luawraps library. ( the library is linked, and i can a wxart2d_Binding dummy in my main, so it is there ). Next i don't know how to change the order of initialization of static objects. I will ask Michael now, maybe he knows a solution, Klaas John Labenski wrote: >>>No back to wxArt2D to see if it is the same there ;-) >>> >>> >>> >>just added the same switch, and now it is oke. >> >> > >Thats good, I have no idea how to fix static initialization problems >elegantly. I would have had use a brute force method that just rems >out static code (and anything that depends on it) until it worked. > > > |
From: John L. <jla...@gm...> - 2005-12-28 15:18:00
|
> > No back to wxArt2D to see if it is the same there ;-) > > > just added the same switch, and now it is oke. Thats good, I have no idea how to fix static initialization problems elegantly. I would have had use a brute force method that just rems out static code (and anything that depends on it) until it worked. > Back to learning the internals of wxLua :-) Let me know if you have any questions. -John |
From: klaas.holwerda <kho...@xs...> - 2005-12-26 17:25:37
|
klaas.holwerda wrote: > > > No back to wxArt2D to see if it is the same there ;-) > just added the same switch, and now it is oke. Oef! Back to learning the internals of wxLua :-) Klaas |
From: klaas.holwerda <kho...@xs...> - 2005-12-26 17:21:06
|
A solution, Following is the contents of the settings dialog under tab Link. ( called project options. ) If i cut and paste the last one ( from wxLua.dsw ) into the one from apps.dsw/app_wxlua. And make a change to force a build, it works. Same trick for app_wxluaedit ( but of course add wxedit.lib too ), makes that one work. Even not forcing a rebuild, but just relink, gives the problem. Is it caused by?: /nodefaultlib:"MSVCRT.lib" Adding this options, and doing a rebuild of e.g. app_wxlua, makes it work. Removing it again, gives the problem again, so i think this is the solution. No back to wxArt2D to see if it is the same there ;-) And the option i was asking for is called /VERBOSE:LIB i think ;-) Klaas wxluasocket.lib wxluadebug.lib wxbind.lib wxlua.lib lua.lib wxmsw26d_stc.lib wxmsw26d_xrc.lib wxmsw26d_html.lib wxmsw26d_media.lib wxmsw26d_adv.lib wxbase26d_net.lib wxbase26d_xml.lib wxmsw26d_core.lib wxbase26d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib oleacc.lib /nologo /subsystem:windows /incremental:yes /pdb:"..\..\..\bin/wxlua.pdb" /debug /machine:I386 /out:"..\..\..\bin\wxlua.exe" /libpath:"$(WXWIN)\lib\vc_lib" /libpath:"..\..\..\lib\vc_lib" wxluadebug.lib wxluasocket.lib wxlua.lib wxbind.lib lua.lib wxmsw26d_stc.lib wxmsw26d_html.lib wxbase26d_net.lib wxmsw26d_xrc.lib wxmsw26d_adv.lib wxbase26d_xml.lib wxmsw26d_core.lib wxbase26d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib oleacc.lib /nologo /subsystem:windows /incremental:yes /pdb:"..\..\..\bin/wxlua.pdb" /debug /machine:I386 /nodefaultlib:"MSVCRT.lib" /out:"..\..\..\bin\wxlua.exe" /libpath:"$(WXWIN)\lib\vc_lib" /libpath:"..\..\..\lib\vc_lib" /VERBOSE:LIB klaas.holwerda wrote: > Hi John, > |
From: klaas.holwerda <kho...@xs...> - 2005-12-26 16:55:57
|
Hi John, ( still Vc6 and 2.6.2 and debug verson of builds) Some more findings. I did a complete new check out of wxLua, went to the build/msw dir. And did a build of app_wxlua in the wxLua.dsw. ( in principle a rebuild all i think ). Guess what, it works fine! Now i go to apps/build/msw and open apps.dsw. I set app_wxlua as active project, and its active configuaration to debug. And now i do a rebuild all on this project, and run wxLua from there. And now there is the same problem again. ( see stack dump of other mails ). For app_wxluaedit the outcome is the same. Now i go back to the first wxLua.dsw. If i run directly app_wxlua from in there the problem is the same, since no build is done. But now i do a change in console.cpp in order to force a build, and everything is oke again. If i go once more tp aps/build/msw/apps.dsw, and make in there a change to console.cpp, to force a build from there, the problem is there again. Can you reproduce this ? If we both have the same problem, we might be able to find what is causing it. Still trying to get things in order for VC.net, but that will take me a day, compiling everything wx etc. Regards, Klaas klaas.holwerda wrote: > Hi, > > John Labenski wrote: > |
From: klaas.holwerda <kho...@xs...> - 2005-12-26 15:21:54
|
Hi, John Labenski wrote: >> >> > >Humm, what compiler, version of wxWidgets? > > Vc6.0 Sp5 wx2.6.2 >I haven't seen this using VC6 or in gcc. I did have some problems with >VC 2003, the free command line one, but I thought it was an oddity. > > If it was only my application, but wxLua seems to have the same problem here. Crash in same stack, with class name wxLuaDebugServer. Same wxLuaedit, but there it is wxLuaShell. This is using the VCproject files like in CVS. In wxArt2D i use Cmake generated project files, so this is no the problem ( linking order etc. ). > > >You should access the lua_State through the m_wxlState.GetLuaState(). >The app wxLua still has the lua_State as a member as a throwback to >the old way and will be removed when I get a chance. > Oke i see, was wondering already why ;-) I just a copy paster here, since i do not understand how everything works together. Once i can actually run something, i think things will become more clear to me. Still i very much hope you will find some time to make a state ot the art sample, to demo how it is done. Not that i what to be pushing ;-) > The whole idea of >using the wxLuaState is that you won't have problems of destroying the >pointer to the lua_State and then trying to access it later. > > Oke, i understand now. Although i don't get that reference counting mechanism. ( like brush and pens in wxWidgets right?) Is it possible that one wants to derive from wxLuaState? I wonder if plain smart pointers would have bin easier/better or not? Not that i know, but in wxArt2D i had problems deriving from wxBrush because of this. In any case, i hope my problems or not due to this. > >What is this string? It should be the name of the class it's trying to >add. > It is! But constantly some othere classname, depending upon the first on added in some app. > I have no idea why this should happen. I guess the stack is >getting messed up by some earlier static initialization and carrying >through. > I think too, and it is related to wxLuaState here :-( >This will be tough to track through, We can look at the >linking order of the object files to follow them backwards to see what >is being initialized before this code is run. > > How to do that? I will now try to test wxLua on Vc.Net, see if the problem is the same there. How is it possible i have this problem and you don't? The only warning i do get is the next, but this doe not harm i think. Linking... LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library wxluaedit.exe - 0 error(s), 1 warning(s) Regards, Klaas |
From: John L. <jla...@gm...> - 2005-12-25 18:13:10
|
> I can compile and link the lua libraries + my own wrappings, but as soon > as i add the next two members to any app, and run that app (doing > really nothing with lua ), i get the crash with stack down here. > This is during m_classinfo static member initialization for > IMPLEMENT_DYNAMIC_CLASS. > It is always the same problm, but if i do the same in any another app, i > get it it the first class initialized all the time. Without the > WxLuaState added, it work fine. Humm, what compiler, version of wxWidgets? > I did check if i only link the need lua libs ones only, and it seems so > from the list i see. > I saw some time a ago (when you were working on wxLua ), when > compiling/linking you had an overview in the output window of linked > libraries, how did you make that setting? Maybe that will tell me more. I haven't seen this using VC6 or in gcc. I did have some problems with VC 2003, the free command line one, but I thought it was an oddity. > class MyApp: public wxApp > { > public: > MyApp(); > > virtual bool OnInit(); > virtual int OnExit(); > > MyFrame *m_frame; > wxLuaState m_wxlState; > lua_State *m_luaState; > }; You should access the lua_State through the m_wxlState.GetLuaState(). The app wxLua still has the lua_State as a member as a throwback to the old way and will be removed when I get a chance. The whole idea of using the wxLuaState is that you won't have problems of destroying the pointer to the lua_State and then trying to access it later. > NTDLL! 77f7f570() > NTDLL! 77f67dc6() > KERNEL32! 77e6c936() > _CrtIsValidHeapPointer(const void * 0x00322bf0) line 1697 > _free_dbg_lk(void * 0x00322bf0, int 1) line 1044 + 9 bytes > _free_dbg(void * 0x00322bf0, int 1) line 1001 + 13 bytes > free(void * 0x00322bf0) line 956 + 11 bytes > wxListKey::~wxListKey() line 379 + 15 bytes > wxListBase::Append(const char * 0x00d166fc, void * 0x00e1be50 class What is this string? It should be the name of the class it's trying to add. I have no idea why this should happen. I guess the stack is getting messed up by some earlier static initialization and carrying through. This will be tough to track through, We can look at the linking order of the object files to follow them backwards to see what is being initialized before this code is run. > wxClassInfo wxEvtHandler::ms_classInfo) line 273 > wxObjectList::Append(const char * 0x00d166fc, void * 0x00e1be50 class > wxClassInfo wxEvtHandler::ms_classInfo) line 1122 + 30 bytes > wxHashTable::Put(const char * 0x00d166fc, wxObject * 0x00e1be50 class > wxClassInfo wxEvtHandler::ms_classInfo) line 485 > wxClassInfo::Register() line 245 > wxClassInfo::wxClassInfo(const char * 0x00d166fc, const wxClassInfo * > 0x00e1be80 class wxClassInfo wxObject::ms_classInfo, const wxClassInfo * > 0x00000000, int 40, wxObject * (void)* 0x00408242 > wxEvtHandler::wxCreateObject(void)) line 77 > $E31() line 66 + 32 bytes > $E35() + 8 bytes > _initterm(void (void)* * 0x00d14114 $S36, void (void)* * 0x00d1600c > ___xc_z) line 525 > WinMainCRTStartup() line 274 + 15 bytes > KERNEL32! 77e7eb69() Regards, John Labenski |
From: klaas.holwerda <kho...@xs...> - 2005-12-25 16:01:55
|
Hi John, I hope you have some ideas which i can still check. After many hours, i still have no idea where to look. I can compile and link the lua libraries + my own wrappings, but as soon as i add the next two members to any app, and run that app (doing really nothing with lua ), i get the crash with stack down here. This is during m_classinfo static member initialization for IMPLEMENT_DYNAMIC_CLASS. It is always the same problm, but if i do the same in any another app, i get it it the first class initialized all the time. Without the WxLuaState added, it work fine. I did check if i only link the need lua libs ones only, and it seems so from the list i see. I saw some time a ago (when you were working on wxLua ), when compiling/linking you had an overview in the output window of linked libraries, how did you make that setting? Maybe that will tell me more. I really don't have a clue what is going on. Any ideas welcome! Klaas class MyApp: public wxApp { public: MyApp(); virtual bool OnInit(); virtual int OnExit(); MyFrame *m_frame; wxLuaState m_wxlState; lua_State *m_luaState; }; NTDLL! 77f7f570() NTDLL! 77f67dc6() KERNEL32! 77e6c936() _CrtIsValidHeapPointer(const void * 0x00322bf0) line 1697 _free_dbg_lk(void * 0x00322bf0, int 1) line 1044 + 9 bytes _free_dbg(void * 0x00322bf0, int 1) line 1001 + 13 bytes free(void * 0x00322bf0) line 956 + 11 bytes wxListKey::~wxListKey() line 379 + 15 bytes wxListBase::Append(const char * 0x00d166fc, void * 0x00e1be50 class wxClassInfo wxEvtHandler::ms_classInfo) line 273 wxObjectList::Append(const char * 0x00d166fc, void * 0x00e1be50 class wxClassInfo wxEvtHandler::ms_classInfo) line 1122 + 30 bytes wxHashTable::Put(const char * 0x00d166fc, wxObject * 0x00e1be50 class wxClassInfo wxEvtHandler::ms_classInfo) line 485 wxClassInfo::Register() line 245 wxClassInfo::wxClassInfo(const char * 0x00d166fc, const wxClassInfo * 0x00e1be80 class wxClassInfo wxObject::ms_classInfo, const wxClassInfo * 0x00000000, int 40, wxObject * (void)* 0x00408242 wxEvtHandler::wxCreateObject(void)) line 77 $E31() line 66 + 32 bytes $E35() + 8 bytes _initterm(void (void)* * 0x00d14114 $S36, void (void)* * 0x00d1600c ___xc_z) line 525 WinMainCRTStartup() line 274 + 15 bytes KERNEL32! 77e7eb69() |
From: k. h. <kla...@nl...> - 2005-12-23 10:45:00
|
k. holwerda wrote: > > > Where can i get the right one? I see it is in wxCode CVS ;-) To bad i can not use cvs from here, but when i get home will get it from there. Klaas -- Unclassified |
From: k. h. <kla...@nl...> - 2005-12-23 10:30:40
|
Hi John, I finally managed to get hold of wxstedit, via a dump of CVS in wxCode.zip. And after making it part of my project, discover that it does not contain wxSTEditorShell While wxledit.h in wxLua contains this: class WXDLLEXPORT wxLuaShell : public wxSTEditorShell StyledTextEditorShell and StyledTextEditor is there. So clearly wxCode has the wrong wxStEdit. Where can i get the right one? Thanks, Klaas k. holwerda wrote: > John, > > > -- Unclassified |
From: John L. <jla...@gm...> - 2005-12-22 19:36:57
|
> >This would be a good idea. I can make a very small demo, maybe just a > >single little class, like a subclassed button. > > > I would be really glad with that. If i understand you well, running a > lua script from within the application would display this button. And if > possible, when pressing the button a function in C++ calls a second lua > script. > What i am special interested in is how to call lua script from C++ > objects, and how to interface information back to lua. I understand this > is based on ConnectEvent(), and the event is bringing the C++ info to > the lua function. You're right, the button is too simple. I think a nice calculator program could be made. Something simple that shows both the C++ end and lua end. You can type things into the window and lua will run them as is and print out the answer, also the C++ side can run lua scripts to implement the buttons. > In the end i want to have a2dCanvasObject draw itself using a luascript. > And this will have its own eventhandler class and customevents and id's. > So i need to understand the mechanism, and how i can use it. > Anyway a sample explaining how to write your own bindings and how to use > them in an application is i think very welcome. I've been doing the simplest thing. I write little lua scripts and send them to wxLuaState::RunString. So, in C++ you get an event from a button or menu item and in the handler call RunString with the appropriate wxLua code. > But when i grep i still see wxLuaInterpreter. I am not yet at the level > of understanding those changes. > I saw wxLuaState all around, it seems you now use a class for the luasta= te. > Would it be possible you write a small introduction on how this all > works, and add it to the docs dir? wxLuaInterpreter is now gone, it's typedefed to the wxLuaState so it should be a seamless change. I am slowly adding some docs. > I am now trying to search the mailing list for this information, but > this is not so easy. > > What is your opinion on using Doxygen for documenting the code. Doxygen > always helps be to understand the structure of code, because it makes it > so easy to browse to almost anything right away. You can run doxygen in the docs dir using the doxygen.cfg file. Let me know if I set it up right, I don't fully understand some of the doxygen settings. > > The result of this seems to be > >that it's fairly straightforward to understand the inner workings now. > > > :-) I am sure you are making things much easier. > Still a small help on where to start, like the most important classes > and how they interact would be cool. > > Sorry for asking so much, i would prefer to help you instead, but first > i need to understand :-( The first thing to do is to walk yourself though the wxLuaState class. From the constructor to adding the bindings, and finally, pushing our print and error handlers into lua. Regards, John Labenski |
From: klaas.holwerda <kho...@xs...> - 2005-12-22 17:03:02
|
Hi John, Thanks for the quick responses (always). John Labenski wrote: >This would be a good idea. I can make a very small demo, maybe just a >single little class, like a subclassed button. > > > I would be really glad with that. If i understand you well, running a lua script from within the application would display this button. And if possible, when pressing the button a function in C++ calls a second lua script. What i am special interested in is how to call lua script from C++ objects, and how to interface information back to lua. I understand this is based on ConnectEvent(), and the event is bringing the C++ info to the lua function. In the end i want to have a2dCanvasObject draw itself using a luascript. And this will have its own eventhandler class and customevents and id's. So i need to understand the mechanism, and how i can use it. Anyway a sample explaining how to write your own bindings and how to use them in an application is i think very welcome. >I hope this helps, > Sure, it looks i am on the right track. > >ps. I think I am very close to being done. I have removed the >wxLuaInterpreter class and replaced it completely with the wxLuaState >class in my own copy of the sources. > But when i grep i still see wxLuaInterpreter. I am not yet at the level of understanding those changes. I saw wxLuaState all around, it seems you now use a class for the luastate. Would it be possible you write a small introduction on how this all works, and add it to the docs dir? I am now trying to search the mailing list for this information, but this is not so easy. What is your opinion on using Doxygen for documenting the code. Doxygen always helps be to understand the structure of code, because it makes it so easy to browse to almost anything right away. > The result of this seems to be >that it's fairly straightforward to understand the inner workings now. > > :-) I am sure you are making things much easier. Still a small help on where to start, like the most important classes and how they interact would be cool. Sorry for asking so much, i would prefer to help you instead, but first i need to understand :-( Thanks, Klaas |
From: k. h. <kla...@nl...> - 2005-12-22 12:51:50
|
John, How do i get it? I looked at wxCode, but it only shows me half of the table in the download area at sourceforge. It almost looks a bug in the sourceforge new style?? I see no button to go to the next part of the download page. Do you see the same, can you maybe sent a recent version, in order to continue with my efforts? Once i get it, how do you use it combined with wxLua? You placed the wxLuaConsole etc. in apps. But should we not put some of the classes in there into a module? I like to use them too, but like this it complicates the reuse of those classes a lot. Meaning extra include paths, not part of a library etc. I think apps stuff should result in an executable, which they do, but when it contains usefull classes in general like i see several, we better put those in a module. What do you think. BTW your other respons is stuck in the mailinglist because of size, i hope to find the passwrd at home ;-) But in the mean time, may you can sent it to be directly? I am hoping for some interesting answers in there ;-) Thanks, Klaas -- Unclassified |
From: John L. <jla...@gm...> - 2005-12-21 22:44:36
|
On 12/21/05, k. holwerda <kla...@nl...> wrote: > Trying to make a start here for external programs. > Read in the docs directory building.txt, arrived at the line: > > If you wish to use the build files for modlues/wxbind that exist in wxLua > for your own project along with your own wxluasetup.h you need to... > > ;-)) Heh, that should be finished. > So let me see. > WXLUASETUP_DIR has made it, so setting the include path to my own > luasetup.h is fine. > > What i am puzzled with is the generation of bindings. > Am i right that those binding are now platform and settings independent, > in can be in principle become part of the wxLua distribution? Yes, there is one last issue of the static int variables used as the tags for lua userdata types. These variables are shared among all off the lua states created and the names of them need to be known if you wish to get a variable from lua to C++. I have been thinking about just using a hashtable for them, but I cannot decide. Currently you must always add bindings to wxLua in the same order, which is done by default, but things will break if you change the order or remove one. > Meaning i do not have to generate those in the future and they have no > relation with my own bindings? Right, they are only for wxWidgets and eventually wxLua will compile without them at all. Though, in that case you don't get any wxWidgets functionality in lua, but you do get a C++ interface for lua. > And if i only want part of the wxLua bindings, this is just a matter of > changing my own luasetup.h and rebuild the wxlua library? Yep, hopefully. > I assume genwxbind.bat can be used for my own wxart2d.rules file. > My wxart2.rules file contains this at the top, but i wonder if this is > needed? > wxlua_dir =3D os.getenv("WXLUA") If you like, it's up to you how you implement it. I've attached a rules file I use for a program of mine. You can compare it with the one in wxLua for the wxWidgets bindings, bindings/wxwidgets/wx.rules. > But reading this in wx.rules, i get the feeling that i need to change > more, in order to > get my own binding in the right place, assuming there is no need to have > them in the same place as the wxWidget bindings. You'll want to put them in your own dir. I have made the bindings completely insulated as a library with no need for any external header files. Everything works by adding new bindings to a static member variable of the wxLuaBinding class. You can compile your bindings however you want, as a separate library or together with your program as object files. Just make sure that you link to your library after linking to wxLua. > In other words i will get a seperate library for my own bindings, next > to the one containing the wxWidget bindings. > Something like: > > wxart2d_dir =3D os.getenv("WXART2D") > > interface_dir =3D wxart2d_dir.."/bindings" > output_dir =3D wxart2d_dir.."/src" > output_header_dir =3D wxart2d_dir.."/include" > > And in the > > interfaceFileList =3D > { > wxart2d.i > } > > This seems to work, many things are generated, and they contain things > related to what is in wxart2d.i ;-) > > What should i do with the next, should i call it wxart2d? Is that oke/wis= e?: > > hook_namespace =3D "wx" I am unsure about this. I have not actually tested what happens if you try to put two bindings into the same namespace. Maybe it works, maybe not. This should be clarified and made to work eventually. > If i do, does that require something from my site to have both bindings > active? No, they'll be loaded automatically. > Is this more or less the approach you have in mind too? > > I think that once we have a working approach, we should add an app which > uses this approach. > So all users will know how to include and use/extend wxLua in their own > application. > This is what wx(lua) is all about, so we better make as easy as possibl= e. This would be a good idea. I can make a very small demo, maybe just a single little class, like a subclassed button. I hope this helps, John Labenski ps. I think I am very close to being done. I have removed the wxLuaInterpreter class and replaced it completely with the wxLuaState class in my own copy of the sources. The result of this seems to be that it's fairly straightforward to understand the inner workings now. |
From: k. h. <kla...@nl...> - 2005-12-21 15:06:35
|
Hi John, Trying to make a start here for external programs. Read in the docs directory building.txt, arrived at the line: If you wish to use the build files for modlues/wxbind that exist in wxLua for your own project along with your own wxluasetup.h you need to... ;-)) So let me see. WXLUASETUP_DIR has made it, so setting the include path to my own luasetup.h is fine. What i am puzzled with is the generation of bindings. Am i right that those binding are now platform and settings independent, in can be in principle become part of the wxLua distribution? Meaning i do not have to generate those in the future and they have no relation with my own bindings? And if i only want part of the wxLua bindings, this is just a matter of changing my own luasetup.h and rebuild the wxlua library? I assume genwxbind.bat can be used for my own wxart2d.rules file. My wxart2.rules file contains this at the top, but i wonder if this is needed? wxlua_dir = os.getenv("WXLUA") But reading this in wx.rules, i get the feeling that i need to change more, in order to get my own binding in the right place, assuming there is no need to have them in the same place as the wxWidget bindings. In other words i will get a seperate library for my own bindings, next to the one containing the wxWidget bindings. Something like: wxart2d_dir = os.getenv("WXART2D") interface_dir = wxart2d_dir.."/bindings" output_dir = wxart2d_dir.."/src" output_header_dir = wxart2d_dir.."/include" And in the interfaceFileList = { wxart2d.i } This seems to work, many things are generated, and they contain things related to what is in wxart2d.i ;-) What should i do with the next, should i call it wxart2d? Is that oke/wise?: hook_namespace = "wx" If i do, does that require something from my site to have both bindings active? Is this more or less the approach you have in mind too? I think that once we have a working approach, we should add an app which uses this approach. So all users will know how to include and use/extend wxLua in their own application. This is what wx(lua) is all about, so we better make as easy as possible. Thanks for some advice, Klaas -- Unclassified |
From: John L. <jla...@gm...> - 2005-12-16 15:37:26
|
On 12/16/05, Gustl Berger <gu...@gm...> wrote: > >I'm a little stumped, did this code of yours ever work with wxLua in > >any version? > > > Yes, it worked with the version 26.254, which you can download from the > official site. > I tested the small test script I sent with it. This code is based directly on that with some modifictions of my own. The current code base is very restructured, but should be logically the same. I'll look into it. > >I'm not sure how to handle the failing lua_getmetatable > >in ttag for the coroutine since I thought that the new lua_State > >copied everything from the old one. > > > I don't know the internals of lua, maybe it does not support this yet. > I have found this site: > > http://lua-users.org/wiki/ResumableVmPatch > Maybe that's the problem? Probably not, the lua at SF is identical to the lua in 26.254 and if you say it works there then it should still work. > Do you really have to make a copy of the lua_State when creating a > coroutine? The problem is that lua itself "copies" the lua_State, maybe not literally, but in my testing of the program gpeddler I found that a new lua_State was created for coroutines and that you had to reassociate the lua_State with wxLua's variables. Regards, John Labenski |
From: Gustl B. <gu...@gm...> - 2005-12-16 06:59:01
|
Hi >I'm a little stumped, did this code of yours ever work with wxLua in >any version? > Yes, it worked with the version 26.254, which you can download from the official site. I tested the small test script I sent with it. >I'm not sure how to handle the failing lua_getmetatable >in ttag for the coroutine since I thought that the new lua_State >copied everything from the old one. > I don't know the internals of lua, maybe it does not support this yet. I have found this site: http://lua-users.org/wiki/ResumableVmPatch Maybe that's the problem? Do you really have to make a copy of the lua_State when creating a coroutine? Houdini |
From: John L. <jla...@gm...> - 2005-12-16 05:13:10
|
> It was not easy to reproduce the situation in a small app but here it is: Ok so it stops as you say, on the line print(list:GetItemCount()); in function func(). I dug a little deeper and the problem is this. In modules/wxlua/wxlbind.cpp int LUACALL wxLua_lua_getTableFunc(lua_State *L) I added this printf statement, where init_xxx are the values by the same name used in the if() statement at the top. 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()); Here's the results #### the first print(list:GetItemCount()); that works wxLuaState::ttag 1 has metatable and is number 119 wxLuaState::ttag 1 has metatable and is number 119 wxLua_lua_getTableFunc 'GetItemCount' pClass -1218929716, userdata 1, lightuserdata 0, ttag 119, class_tag 119 lua_State 138563408 wxLuaStateRefData 136376552 # not really sure where these come from? but I suppose its ok wxLuaState::ttag 1 has metatable and is number 284 wxLuaState::ttag 1 has metatable and is number 119 #### the coroutine creates a new lua_State and we add ourselves to it (note the memory locations of the old and new (L1) lua_States) wxLuaInterpreter_newthread_handler new lua_State from a thread L=3D138563408 L1=3D138743720 #### we fail on trying to run wxLuaState::ttag(1) in wxLua_lua_getTableFunc (see ttag below) wxLuaState::ttag 1 wxLuaState::ttag 1 #### so the only thing wrong is ttag, we're got the new lua_State for the coroutine and we're still using the old wxLuaStateRefData (eg. the class that holds the wxLua data) wxLua_lua_getTableFunc '{unknown}' pClass -1218929716, userdata 1, lightuserdata 0, ttag 0, class_tag 119 lua_State 138743720 wxLuaStateRefData 136376552 The coroutine fails on lua_getmetatable() for the coroutine in this functio= n int wxLuaState::ttag(int index) { wxCHECK_MSG(Ok(), TLUA_NOTAG, wxT("Invalid wxLuaState")) lua_State* L =3D M_WXLSTATEDATA->m_lua_State; wxPrintf(wxT("wxLuaState::ttag %d"), index); int tag =3D TLUA_NOTAG; if (lua_getmetatable(L, index) !=3D 0) { wxPrintf(wxT(" has metatable")); lua_pushliteral(L, "tag"); lua_rawget(L, -2); if (lua_isnumber(L, -1)) { tag =3D (int) lua_tonumber(L, -1); wxPrintf(wxT(" and is number %d"), tag); } lua_pop(L, 2); } wxPrintf(wxT("\n")); return tag; } > frame =3D wx.wxFrame(wx.wxNull, -1, "App", > wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxDEFAULT_FRAME_STYLE)= ; > > list =3D wx.wxListCtrl(frame, -1, > wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxLC_SINGLE_SEL + > wx.wxLC_REPORT + wx.wxLC_AUTOARRANGE); > > -- works > print(list:GetItemCount()); > > function func() > > -- crashes > print(list:GetItemCount()); > > coroutine.yield(); > print(3); > end > > cr =3D coroutine.create(func); > > coroutine.resume(cr); > print(2); > coroutine.resume(cr); > > >I have added > >this code already, could you try again in a couple hours (for SF to > >sync it's cvs). > > > No sync yet, so I could not test the changes. I'm a little stumped, did this code of yours ever work with wxLua in any version? I'm not sure how to handle the failing lua_getmetatable in ttag for the coroutine since I thought that the new lua_State copied everything from the old one. Anyone have any ideas? I've committed by debugging printf statements to hel= p. Thanks, John Labenski |
From: Gustl B. <gu...@gm...> - 2005-12-15 23:04:24
|
Hi > >Humm, do you have a smallish wxLua script that demonstrates the >problem? I think I know what the problem is, but I don't have any >coroutine code. We had to make a small modification to lua to stick >the wxLuaInterpreter into any new lua_States created by coroutines, >but I think I need to do the same for the wxLuaState. > It was not easy to reproduce the situation in a small app but here it is: frame = wx.wxFrame(wx.wxNull, -1, "App", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxDEFAULT_FRAME_STYLE); list = wx.wxListCtrl(frame, -1, wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxLC_SINGLE_SEL + wx.wxLC_REPORT + wx.wxLC_AUTOARRANGE); -- works print(list:GetItemCount()); function func() -- crashes print(list:GetItemCount()); coroutine.yield(); print(3); end cr = coroutine.create(func); coroutine.resume(cr); print(2); coroutine.resume(cr); >I have added >this code already, could you try again in a couple hours (for SF to >sync it's cvs). > No sync yet, so I could not test the changes. Houdini |
From: John L. <jla...@gm...> - 2005-12-15 21:39:14
|
On 12/15/05, Gustl Berger <gu...@gm...> wrote: > >Let me know if the above anonymous cvs command doesn't work for you > > > You were right, Sourceforge was not the problem (I tried and failed > several times, then I read that something was wrong with anonymous CVS...= ). > Compiling it under Visual Studio 2005 worked fine. good. > >and also if you find any bugs. > > > As I wrote in the previous mail, I have already written an application > with an old version of wxLua. But when I run the script in the new > version, coroutines do not work anymore. > > wxLua: Error while running chunk > wxLua: Attempt to call an invalid method '{unknown}'. > stack traceback: > [C]: in function 'resume' > ... Humm, do you have a smallish wxLua script that demonstrates the problem? I think I know what the problem is, but I don't have any coroutine code. We had to make a small modification to lua to stick the wxLuaInterpreter into any new lua_States created by coroutines, but I think I need to do the same for the wxLuaState. I have added this code already, could you try again in a couple hours (for SF to sync it's cvs). > I saw that you made some changes in the lua code. I tried disabling them > / replacing the lua library with the original version, but that did not > solve the problem. I think you're refering to the above, this change in lua itself is unfortunately necessary otherwise the new lua_State created by the coroutine doesn't know anything about the wxLua wrappers. Regards, John Labenski |