Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Current porting state?
Re: Current porting state? [message #5300 is a reply to message #5299] Wed, 13 September 2006 08:51 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
luzr wrote on Wed, 13 September 2006 15:10



HelloWorld is still too big. First thing that you should make working when porting is logging (LOG and DUMP).



Alas, I have no idea how I'm supposed to compile/link a
CONSOLE_APP_MAIN { LOG("Hello world!"); }
with the ide, nor have I seen a guide to that effect.. Some hints here would help me plenty.

Quote:


Rather stay with malloc. If there is something highly platform sensitive, it is heap allocator implementation.



Alright, it is back on, same cores.

Quote:


Compiling HelloWorld failed due to:

StaticCriticalSection::Initialize

Error?



That Initialize was undefined. Seems mt.cpp has it in #ifdef _MULTITHREADED but the mt.h does not. This compiler insist it to be defined if it is prototyped in the class.

Similarly, Get method.

Quote:


Actually, I believe that debugger and compiler are correct. Just somehow s contains invalid address.




Understood.

Re: Current porting state? [message #5302 is a reply to message #5300] Wed, 13 September 2006 09:21 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Might not be right, but I gutted hello.cpp to be able to proceed:

# ./HelloWorld
#

# cat ~/.HelloWorld.log
* HelloWorld 13.09.2006 16:19:47, user: lundman

%02d:%02d:%02d log is persistentUnable tHello world!
#
Re: Current porting state? [message #5303 is a reply to message #5302] Wed, 13 September 2006 10:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Wed, 13 September 2006 03:21


Might not be right, but I gutted hello.cpp to be able to proceed:

# ./HelloWorld
#

# cat ~/.HelloWorld.log
* HelloWorld 13.09.2006 16:19:47, user: lundman

%02d:%02d:%02d log is persistentUnable tHello world!
#



Interesting. Now what about

CONSOLE_APP_MAIN {
   for(int i = 0; i < 100; i++)
      LOG(i);
}
CONSOLE_APP_MAIN {
   for(int i = 0; i < 100; i++)
      LOG(GetSysDate() + i);
}
CONSOLE_APP_MAIN {
   Vector<Date> m;
   for(int i = 0; i < 100; i++)
      m.Add(GetSysDate() + i);
   DUMPC(m);
}
CONSOLE_APP_MAIN {
   FileOut out(ConfigFile("test"));
   for(int i = 0; i < 100; i++)
      out << GetSysDate() + i);
   DUMP(LoadFile(ConfigFile("test"));
}

Re: Current porting state? [message #5304 is a reply to message #5303] Wed, 13 September 2006 11:15 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
luzr wrote on Wed, 13 September 2006 17:01



CONSOLE_APP_MAIN {
   for(int i = 0; i < 100; i++)
      LOG(i);
}



* HelloWorld 13.09.2006 17:43:34, user: lundman

%02d:%02d:%02d log is persistentUnable t0
1
2
[snip]
98
99



Quote:


CONSOLE_APP_MAIN {
   for(int i = 0; i < 100; i++)
      LOG(GetSysDate() + i);
}



* HelloWorld 13.09.2006 17:47:48, user: lundman

%02d:%02d:%02d log is persistentUnable t09/13/2006
09/14/2006
09/15/2006
[snip]
12/20/2006
12/21/2006


Quote:


CONSOLE_APP_MAIN {
   Vector<Date> m;
   for(int i = 0; i < 100; i++)
      m.Add(GetSysDate() + i);
   DUMPC(m);
}



* HelloWorld 13.09.2006 17:55:17, user: lundman

%02d:%02d:%02d log is persistentUnable tm:
        [0] = 09/13/2006
        [1] = 09/14/2006
[snip]
        [98] = 12/20/2006
        [99] = 12/21/2006


Quote:


CONSOLE_APP_MAIN {
   FileOut out(ConfigFile("test"));
   for(int i = 0; i < 100; i++)
      out << GetSysDate() + i;
   DUMP(LoadFile(ConfigFile("test")));
}



(Moved brackets to fix)
* HelloWorld 13.09.2006 18:11:45, user: lundman

%02d:%02d:%02d log is persistentUnable tLoadFile(ConfigFile("test")) = 

cat ~/.HelloWorld/test
09/13/200609/14/200609/15/200609/16/200609/17/200609/18/200609/19/200609/20/200609/21/200609/22/200609/23/200609/24/200609/25/200609/26/200609/27/200609/28/200609/29/200609/30/200610/01/200610/02/200610/03/200610/04/200610/05/200610/06/200610/07/200610/08/200610/09/200610/10/200610/11/200610/12/200610/13/200610/14/200610/15/200610/16/200610/17/200610/18/200610/19/200610/20/200610/21/200610/22/200610/23/200610/24/200610/25/200610/26/200610/27/200610/28/200610/29/200610/30/200610/31/200611/01/200611/02/200611/03/200611/04/200611/05/200611/06/200611/07/200611/08/200611/09/200611/10/200611/11/200611/12/200611/13/200611/14/200611/15/200611/16/200611/17/200611/18/200611/19/200611/20/200611/21/200611/22/200611/23/200611/24/200611/25/200611/26/200611/27/200611/28/200611/29/200611/30/200612/01/200612/02/200612/03/200612/04/200612/05/200612/06/200612/07/200612/08/200612/09/200612/10/200612/11/200612/12/200612/13/200612/14/200612/15/200612/16/200612/17/200612/18/200612/19/200612/20/200612/21/2006



Re: Current porting state? [message #5305 is a reply to message #5304] Wed, 13 September 2006 11:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, that

"%02d:%02d:%02d log is persistentUnable t"

is strange, but I think I have seen something similiar in Linux, so this bug (which I will resolve ASAP) is most likley harmless.

Rest seem to work OK.

BTW, what is the status of "tweaks"? USEMALLOC, commenting lines in platform headers etc?
Re: Current porting state? [message #5306 is a reply to message #5272] Wed, 13 September 2006 11:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Quote:


0xffff86f8 in ___bzero () at
/System/Library/Frameworks/System.framework/PrivateHeaders/p pc/cpu_capabilities.h:187
101::memset(&obj, 0, sizeof(obj));



What about backtrace? (stack)

Quote:


Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x3a262ff8
0x0026e500 in UnpackRLE (t=0x3a262ff8, s=0x421995 "ËËËÃÔ×\205o^rQ:\204a4\030\003vT=\215udÙåç\001òòò", len=<incomplete type>) at /Users/lundman/uppsrc/uppsrc/Draw/ImageBlit.cpp:51
51 *t++ = h;

Also seems odd, perhaps still related to the first issue, so I need to track that down first.



Backtrace?

Could you please check

CONSOLE_APP_MAIN {
DUMP((void *)new byte[100]);
}

to find out where OSX tends to place allocations? (0x3a262ff8 seems a little high for me...).

Mirek
Re: Current porting state? [message #5307 is a reply to message #5305] Wed, 13 September 2006 11:42 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Tweaks are, USEMALLOC on, and about 3 memset, 1 memcpy are commented out.

memset/memcpy in Core/Util.h and memset in Draw/Image.cpp

I shall try with them back in now....


and it's identical.

* HelloWorld 13.09.2006 18:39:01, user: lundman

%02d:%02d:%02d log is persistentUnable tLoadFile(ConfigFile("test")) = 


9/13/200609/14/200609/15/200609/16/200609/17/200609/18/200609/19/200609/20/200609/21/200609/22/200609/23/200609/24/200609/25/200609/26/200609/27/200609/28/200609/29/200609/30/200610/01/200610/02/200610/03/200610/04/200610/05/200610/06/200610/07/200610/08/200610/09/200610/10/200610/11/200610/12/200610/13/200610/14/200610/15/200610/16/200610/17/200610/18/200610/19/200610/20/200610/21/200610/22/200610/23/200610/24/200610/25/200610/26/200610/27/200610/28/200610/29/200610/30/200610/31/200611/01/200611/02/200611/03/200611/04/200611/05/200611/06/200611/07/200611/08/200611/09/200611/10/200611/11/200611/12/200611/13/200611/14/200611/15/200611/16/200611/17/200611/18/200611/19/200611/20/200611/21/200611/22/200611/23/200611/24/200611/25/200611/26/200611/27/200611/28/200611/29/200611/30/200612/01/200612/02/200612/03/200612/04/200612/05/200612/06/200612/07/200612/08/200612/09/200612/10/200612/11/200612/12/200612/13/200612/14/200612/15/200612/16/200612/17/200612/18/200612/19/200612/20/200612/21/2006



Re: Current porting state? [message #5308 is a reply to message #5306] Wed, 13 September 2006 11:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Image::Image(const Init& init)
{
	ASSERT(init.info[0] >= 1);
	Size sz;
	sz.cx = PeekIL(init.info + 1);
	sz.cy = PeekIL(init.info + 5);
	ImageBuffer b(sz);
	int i = 0;
	while(i < init.scan_count) {
		UnpackRLE(b[i], (const byte *)init.scans[i], sz.cx);
		i++;
	}
	while(i < sz.cy)
		memset(b[i++], 0, sizeof(RGBA) * sz.cx);
	b.SetHotSpot(Point(PeekIL(init.info + 9), PeekIL(init.info + 13)));
	Set(b);
}


Maybe PeekIL is the cause as it is affected by endianess.

It is defined in Core/util.h, util.cpp.

Maybe it is worth checking what is the status of

CPU_X86
CPU_LE
CPU_UNALIGNED

macros....

[Updated on: Wed, 13 September 2006 11:46]

Report message to a moderator

Re: Current porting state? [message #5309 is a reply to message #5307] Wed, 13 September 2006 11:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Wed, 13 September 2006 05:42


Tweaks are, USEMALLOC on, and about 3 memset, 1 memcpy are commented out.

memset/memcpy in Core/Util.h and memset in Draw/Image.cpp

I shall try with them back in now....


and it's identical.



If I understand you well, most of Core works without tweaks? That is a good prerequisite to further testing Wink

Mirek
Re: Current porting state? [message #5310 is a reply to message #5308] Wed, 13 September 2006 11:53 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

This part of the system is new to me, but I define:

-DflagGUI -DflagGCC32 -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagBLITZ -DflagOSX -DflagUSEMALLOC

Core.h has hmm oh I see. You define default to be X86. I assumed the default would not set anything. My Bad.

Now there is a CPU_PPC, which I also set in Makefile

Recompiling.
Re: Current porting state? [message #5311 is a reply to message #5310] Wed, 13 September 2006 11:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
#elif defined(flagPPC)
	#define CPU_32
	#define CPU_PPC
	#define CPU_BE
	#define CPU_BIG_ENDIAN
	#define CPU_ALIGNED
#else


Is that correct?
Re: Current porting state? [message #5312 is a reply to message #5311] Wed, 13 September 2006 12:03 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Yep, pricely that. The examples you sent run just the same, rebuilding the ide/HelloWorld just to see if it does something differently.

Re: Current porting state? [message #5313 is a reply to message #5312] Wed, 13 September 2006 12:11 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

http://netbsd.interq.or.jp/~lundman/osx1.jpg

http://netbsd.interq.or.jp/~lundman/osx2.jpg

http://netbsd.interq.or.jp/~lundman/osx3.jpg

Same/similar gfx bug I get on Intel, but more advanced.

Quite encouraging though.

Re: Current porting state? [message #5314 is a reply to message #5313] Wed, 13 September 2006 12:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Wed, 13 September 2006 06:11


http://netbsd.interq.or.jp/~lundman/osx1.jpg

http://netbsd.interq.or.jp/~lundman/osx2.jpg

http://netbsd.interq.or.jp/~lundman/osx3.jpg

Same/similar gfx bug I get on Intel, but more advanced.

Quite encouraging though.




Those missing icons in the list are caused by that "return s" you have placed into UnpackRLE Wink

Mirek
Re: Current porting state? [message #5315 is a reply to message #5314] Wed, 13 September 2006 12:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Those gfx problems look like a result .icpp makefile bug - chameleon initialization is not working.

I believe that recompilation using TheIDE will solve them.
Re: Current porting state? [message #5316 is a reply to message #5314] Wed, 13 September 2006 12:27 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Hah! totally forgot about that!

One second:

http://netbsd.interq.or.jp/~lundman/osx2.jpg

http://netbsd.interq.or.jp/~lundman/osx3.jpg

Now its exactly like NetBSD/Intel Smile

I shall try to compile an example to see if they work.

Re: Current porting state? [message #5317 is a reply to message #5316] Wed, 13 September 2006 12:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hm actually, as for compiling in TheIDE, there will be trouble with flagPPC I am afraid. Maybe just put #define flagPPC into beginning of Core.h for now...
Re: Current porting state? [message #5318 is a reply to message #5317] Wed, 13 September 2006 12:33 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

/Users/lundman/uppsrc/uppsrc/Core/Core.h:11:1: warning: "flagPPC" redefined
<command line>:1:1: warning: this is the location of the previous definition


Can't compile the example, as it doesn't find CtrlLib/CtrlLib.h

Did I mess something starting it the first time, or do I have to set up a build environment?

Re: Current porting state? [message #5319 is a reply to message #5318] Wed, 13 September 2006 12:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You will definitely have to setup build method. (in Setup menu)

Mirek
Re: Current porting state? [message #5320 is a reply to message #5318] Wed, 13 September 2006 12:46 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, nope, I was wrong, for <CtrlLib/CtrlLib.h>, the problem is different. TheIDE build system should put paths to all nests as include paths on commandline.

Please activate verbose mode and check...

Mirek
Previous Topic: SO for Draw, Esc and other packages
Next Topic: C strings
Goto Forum:
  


Current Time: Mon Apr 29 17:38:33 CEST 2024

Total time taken to generate the page: 0.03254 seconds