Game Development Community

Help debuggin on the device

by Eyal Erez · in iTorque 2D · 12/12/2008 (5:04 pm) · 5 replies

So I've finally managed to get the telnet working and use Torsion to debug the device.
My game never crash on the Mac and about 40% of the time crash on the iPhone right at startup when it loads all the scripts via exec().
My problem is that every time I run it , it crash with no errors and in a different script. obviosly it's not the scripts. maybe some memory issue?
Can you guys suggest any debugging method? just looking at the console log doesn't help.
I'm loading about 20 .cs and .gui files and there is no consistency to where its crashing.
Thanks.
Eyal.

#1
12/12/2008 (5:20 pm)
Does the iPhone give an error message when it crashed? Something like EXC_BAD_ACCESS.
Any schedule() commands getting called?
Other than that, it's hard to say without seeing it.
#2
12/12/2008 (5:58 pm)
In the console there are no errors.
Are these kind of error should appear in the xcode-organizer-crash log ? should I look for it there?
For some reason it always works when I run it via xcode "build and Go". it only crash when I run it through the iPhone icon.
#3
12/14/2008 (3:13 pm)
Did you by error send over a debug build instead of a release build?
#4
12/15/2008 (8:02 am)
No, it is a release / distribution build.
The strangest thing is that is always works when using xcode build and go. and fails most of the time when launching from the iPhone.
I couldn't figure out why it was crashing , but I managed to solve the problem. I knew that it was crashing while loading (exec) all of my scripts at game.cs startGame() even though it was in a different script and never constant. so I've changed initialize project and commented out startGame(). that didn't crash.
My next step was to load my mainMenu.gui in initializeProject() by exec the .gui and setConten(mainMenuGui). that worked too.
then I created another function called mm_startGame() which I used to exec(game.cs) I called mm_startGame() from initializeProject using a schedule(100,mm_startGame) and that hasn't crashed yet.
very strange. why would loading the mainMenu.gui first or schedule a delay for startGame would help?
Anyway I'm just happy it works now. debuging using crash log is way above my programming skills.
#5
12/16/2008 (2:44 pm)
No idea actually. there are quit a few common things that could cause that, but they should be handled by the technology on its own