diff -r 2c19c7cf5550 -r c20dd21d1eb4 mtpfws/mtpfw/common/inc/mtpdebug.h --- a/mtpfws/mtpfw/common/inc/mtpdebug.h Fri Aug 20 17:43:33 2010 +0800 +++ b/mtpfws/mtpfw/common/inc/mtpdebug.h Fri Sep 03 18:38:04 2010 +0800 @@ -21,6 +21,9 @@ #ifndef MTPDEBUG_H #define MTPDEBUG_H +/* + * Todo: keep these macros temporarily, will discard them at last + */ #include __FLOG_STMT(_LIT8(KMTPSubsystem, "MTP");) @@ -39,4 +42,42 @@ #define __MTP_HEAP_FLOG #endif // __FLOG_ACTIVE +/* + * Unlike __FLOG_ACTIVE, every component has its own macro OST_TRACE_COMPILER_IN_USE . + * Thus the macro won't be used in this header file. + */ +#define __MTP_HEAP_OSTTRACE(r) \ + { \ + TInt allocated; \ + TInt largest; \ + TInt available(User::Heap().Available(largest)); \ + TInt size(User::Heap().Size()); \ + User::Heap().AllocSize(allocated); \ + r;\ + } + +#define LEAVEIFERROR(err, trace) \ +{ \ +TInt munged_err=(err); \ +if (munged_err < 0) \ +{ \ +trace; \ +User::Leave(munged_err);\ +}\ +} + +#define TRACEPANIC(aReason, trace) \ + { \ + tp; \ + User::Panic(KMyCategory, (aReason)); \ + } + +#if defined(_DEBUG) +#define __ASSERT_DEBUG_OST(c,trace,p) if(!c) {trace; p;} +#else +#define __ASSERT_DEBUG_OST(c,trace,p) +#endif + +#define __ASSERT_ALWAYS_OST(c,trace,p) if(!c) {trace; p;} + #endif // MTPDEBUG_H