Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 13:53
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Quad), 6,361 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Wanted: Your best tips on debugging lite-c apps #199898
04/01/08 17:16
04/01/08 17:16
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline OP
Expert
Uhrwerk  Offline OP
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
The topic title says it all. How do you investigate on finding bugs in your lite-c applications?

My usual method is to place a printf("before"); and a printf("after"); in the code surrounding the place where I expect the crash. Then I iteratively change the position of them so that i get closer and closer to the crash. Printing out some debug information with printf is also very usefull sometimes.


Always learn from history, to be sure you make the same mistakes again...
Re: Wanted: Your best tips on debugging lite-c apps [Re: Uhrwerk] #199902
04/01/08 17:18
04/01/08 17:18
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
i do the same.


3333333333
Re: Wanted: Your best tips on debugging lite-c apps [Re: Quad] #199909
04/01/08 17:35
04/01/08 17:35
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Me too, placeing printf("Test1"); ... printf("Test2"); ... printf("Test3"); helps to find out where the error is.

Re: Wanted: Your best tips on debugging lite-c apps [Re: PadMalcom] #199912
04/01/08 17:58
04/01/08 17:58
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
I USE A PANEL WHITE 5 VARS wit as most as possable precisesion so you can see if its like 0,001so you dont miss anything
sometimes i use a text debug

and if i can find the problem i write return to see were te problem is if the problem still is there you need to write return on a other place

and dont forget if you place return inside a loop and there is no error its in the loop


"empty"
Re: Wanted: Your best tips on debugging lite-c app [Re: flits] #199974
04/01/08 23:59
04/01/08 23:59
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
First I locate the error in a small block of code. Then I think of all possibilities that could occur making my application crash.

If I can't solve it, then I start checking all variables (pointer, numbers, more pointers, strings, again pointers) which have a relation to the false code on weird behaviour. If I detect abnormalities here, I usually find the bug soon as well.

No abnormalities? Then it's time to have a little private conversation with the piece of code. I make a copy of the whole script and cut as much unnecessary code out as possible, or replace with dummy data. Usually it will work then, and from here I try every possibility to make it crash the same way it did in the old code until I found out why.

If it does crash right after placing it within it's new scope, I start to get hopeless and post on the forum asking why my game hates me and break down in tears.

Last edited by Joozey; 04/02/08 00:00.

Click and join the 3dgs irc community!
Room: #3dgs

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1