Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [GDK] Usefull debugging macros and source

Author
Message
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 17th Apr 2010 04:36
I hate the fact that GDK does not include debug build libraries. Many of the debugging features of VS2008 are disabled since we can not #define _DEBUG in our projects...

Mostly, I hate not being able to utilize the TRACE/VERIFY/ASSERT macros while debugging so that I can catch errors in the early stages...

I'm a firm believer in ASSERT()-ing errors in that they allow me to identify (during debugging) that perhaps my assumption is incorrect... With out the _DEBUG pre-processor directive (among other things - [LIBCMTD for instance]) I lose those valuable (to me anyways) debugging aides...

So, I've wrote my own MY* equivalent versions and here they are:

Debugging.h file:


and the supporting Debugging.CPP file:



If you're at all familiar with ASSERT/TRACE/VERIFY, you have probably already made your own versions; however, this version includes a new definition: MYERROR() whereby an error message is displayed - without the need for a failed ASSERT. Simply call MYERROR(msg) and you get an error box stating the error message... Very handy stuff, indeed...


Enjoy,
JTK

Login to post a reply

Server time is: 2024-05-03 22:02:02
Your offset time is: 2024-05-03 22:02:02