Re: wxEuphoria
- Posted by jbrown1050 at hotpop.com Feb 13, 2003
- 710 views
On Wed, Feb 12, 2003 at 07:24:03AM -0500, Matthew Lewis wrote: > > > > From: jbrown1050 at hotpop.com [mailto:jbrown1050 at hotpop.com] > > > I just translated some C++ code into asm. I don't understand > > it however. :[ > > As far as I can tell, it appears to be cdecl ... not entirely sure > > however. > > > > Maybe I'll have g++ translate the code into preprocessed C. > > That should > > be easier to read. > > Yes, from everything I've seen (not a whole lot), everything in linux should > be cdecl, so that should be pretty simple. I've started separating out code > that's windows specific, so that a user would simply include wxWin.e or > wxLinux.e. There may also be certain classes that will be OS specific, but > we'll just have to wait and see. Rather than using call_thiscall directly, > I've put call_member() in wxWin.e which calls call_thiscall(). In > wxLinux.e, it would be call_cdecl(). You are right. I taken another look (or to be more accurate, many many many many many many many many many more looks ... i really need to brush up on my asm) at the code produced by g++ (the asm code, as the preprocess option just creates code w/o the #include's and #define's and such). The asm code for the C class, uses cdecl all the way, and the first parameter, would appear to be the 'this' pointer. (I see the first parameter as "-8(%ebp)" however ... not sure what that is, its AT&T syntax of course....) > <snip> > > > In linux, the command 'nm' gets the list of symbols exported > > by a shared library. > > Not sure about ordinal however. > > I don't think Linux uses the concept of ordinals. We'll just have to figure > out what the undecorated names are. I also created a file, wxDefsMsw.e, > where I've wrapped the ordinals into constants, so they'll be easier to > import as needed. I expect we'd take the output of 'nm' and do the same. > > Matt Lewis > Well, nm gets the list of names from an executable and prints the names out, along with the symbol's type and value. It has a demangle option, so the asm names are converted back to readable C++ names. We'd probably have to compare outputs of nm on the wxWindows .so file, once with demangling and once without, and then import the functions in wxEuphoria via the mangled names, as you have already guessed. If I can, I'll try to write a function that can automaticly demangle the names directly, thus avoiding the need to compare such a huge list of names for wxEuphoria with nm .. twice. jbrown > > > TOPICA - Start your own email discussion group. FREE! -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |