Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, TipmyPip), 1,333 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to find an empty pointer? #374699
06/21/11 01:08
06/21/11 01:08
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
On one of my functions, the engine crashes saying that the pointer is empty.
Is there is a way to find exacly WHAT POINTER IS IT?!?!
Because engine crashes gives line numbers and reason of the crash, wich is easy to find, but runtime crashes only points to the function and don´t say nothing else.
I´ve gone trought this crap enough times, what i need to do to find this godamn pointer?
Any help is appreciated, thanks in advance.

Re: How to find an empty pointer? [Re: Ericmor] #374706
06/21/11 04:07
06/21/11 04:07
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
What you need is printf() debugging. Just throw a bunch of printf() calls into the function and look what the last message is before the application crashes. The pointer you used after the printf() call is most likely the evil one.

First you should narrow the region of the crash down by putting a few printf() into the function, then you put some more printf() calls into the region where you assume the crash is. When you believe you found the line, alter it and look if the crash changes.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: How to find an empty pointer? [Re: WretchedSid] #374715
06/21/11 06:59
06/21/11 06:59
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Many thanks Justsid, gonna try that.
Sorry for the rude post, i just lost a complete working assemble of RPG making instructions for the new Lite-C syntax and rebuilding everthing from scratch is taking a tool on my patience.
Again, thanks.

Re: How to find an empty pointer? [Re: Ericmor] #374718
06/21/11 08:12
06/21/11 08:12
Joined: Feb 2011
Posts: 135
Myrkling Offline
Member
Myrkling  Offline
Member

Joined: Feb 2011
Posts: 135
If I'm not mistaken you could also use sys_marker.
Code:
sys_marker("AAA");
// ... first code section ...
sys_marker("BBB");
// ... second code section ...
sys_marker(NULL);


If an error occurs in the first code section, the error message should contain "AAA"; if an error occurs in the second section, the message should contain "BBB".
I've never used it though, and don't know whether it actually works that way.


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

Gamestudio download | chip programmers | 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