Click here to Skip to main content
Click here to Skip to main content

Extended Debug macros

By , 13 Jun 2001
 

Sample Image - LJSDebug.gif

Introduction

This code makes debugging somewhat easier. This code is simply a macro definition file.

The MFC TRACE macro only outputs messages to the Debug window, moreover, it is of no use with Release builds. The VERIFY and ASSERT macros are also no use with Release builds. If we could control debug macro regardless of compile mode, it would be easier for us to debug. So I coded this. It is simply macro definition, but useful, I think.

The macros are:

// These macros return false and exit function when expression is false
CHECKEXPR(bExpression, ERRORMSG, RETURNVALUE) 
CHECKVOIDEXPR(bExpression, ERRORMSG) 
CHECKFUNC(bExpression, ERRORMSG, RETURNVALUE) 
CHECKVOIDFUNC(bExpression, ERRORMSG) 

// This macro exits the program when expression is false
EXITCHECKEXPR(bExpression, ERRORMSG, RETURNVALUE) 
EXITCHECKVOIDEXPR(bExpression, ERRORMSG) 
EXITCHECKFUNC(bExpression, ERRORMSG, RETURNVALUE) 
EXITCHECKVOIDFUNC(bExpression, ERRORMSG) 

If an unexpected situation occurs we would like to exit program at that time, or ignore the situation and force processing. If you want to exit the program, we can use the EXITCHECK* macro, if you want to ignore the error and continue, use the CHECK* macro.

The only thing you need to do to use this macro file is add

#include "LJSDebug.h"

in you file. You must pre-define __LJS__DEBUG__YES__ or __LJS__DEBUG__NO__ before you add #include "LJSDebug.h".

It works under Unicode and with VC++ 6.0. It's ok for any one use and modify this file freely.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Jungsul Lee
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralDocumentationmemberAlbert van Peppen19 Jun '01 - 22:21 
Can you please use english documentation instead of korean... Confused | :confused:
I can't understand a bit of it since i only see smileys and other such characters..
 
Thanks in advance..
 

Albert van Peppen
GeneralRe: DocumentationmemberAnonymous19 Jun '01 - 22:55 

Can't you read english letters in the document? I wrote english as same contents just upper line of korean.
 
Thank you.Confused | :confused:

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 14 Jun 2001
Article Copyright 2001 by Jungsul Lee
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid