sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Bootstrap Shadow Memory Region Tests sl@0: // sl@0: sl@0: #ifndef SMR_DEBUG_H sl@0: #define SMR_DEBUG_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: // Make sure release builds get a warning if sl@0: //#ifndef _DEBUG sl@0: //#if (defined SMR_TRACE) sl@0: //#warning "Use of Kern::PrintF tracing in a release build, check MMP files" sl@0: //#endif sl@0: //#endif sl@0: sl@0: // Panic category string for SMR component sl@0: _LIT(KSMRPanicCategory, "T_SMR"); sl@0: sl@0: sl@0: // sl@0: // MACROs for trace statements in client/server code. sl@0: // sl@0: sl@0: #ifdef SMR_TRACE sl@0: sl@0: #define SMR_LOG0(_text) Kern::Printf((_text)) sl@0: #define SMR_LOG1(_text, _a1) Kern::Printf((_text), (_a1)) sl@0: #define SMR_LOG_RETURN(_r1) { Kern::Printf("!-- Function exit : %d", (_r1)); \ sl@0: return (_r1); } sl@0: #define SMR_LOGMSG_RETURN(_s1, _r1) { Kern::Printf("!-- "_s1" (%d)", (_r1)); \ sl@0: return (_r1); } sl@0: sl@0: #define SMR_TRACE0(_text) Kern::Printf((_text)) sl@0: #define SMR_TRACE1(_text, _a1) Kern::Printf((_text), (_a1)) sl@0: #define SMR_TRACE2(_text, _a1, _a2) Kern::Printf((_text), (_a1), (_a2)) sl@0: #define SMR_TRACE3(_text, _a1, _a2, _a3) Kern::Printf((_text), (_a1), (_a2), (_a3)) sl@0: #define SMR_TRACE4(_text, _a1, _a2, _a3, _a4) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4)) sl@0: #define SMR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5)) sl@0: #define SMR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6)) sl@0: sl@0: #define SMR_FUNC(_text) TEntryExit _entryexit(_text) sl@0: #define SMR_FUNCE(_text) Kern::Printf("--> "##_text) sl@0: #define SMR_FUNCR(_text) Kern::Printf("<-- "##_text) sl@0: #define SMR_FUNCR_return(_text, _r1) { Kern::Printf("<-- "##_text##"\n"); \ sl@0: return (_r1); } sl@0: sl@0: #else sl@0: sl@0: #define SMR_LOG0(_text) Kern::Printf(_L(_text)) sl@0: #define SMR_LOG1(_text, _a1) Kern::Printf(_L(_text), (_a1)) sl@0: #define SMR_LOG_RETURN(_r1) { return (_r1); } sl@0: #define SMR_LOGMSG_RETURN(_s1, _r1) { return (_r1); } sl@0: sl@0: sl@0: #define SMR_TRACE0(_text) sl@0: #define SMR_TRACE1(_text, _a1) sl@0: #define SMR_TRACE2(_text, _a1, _a2) sl@0: #define SMR_TRACE3(_text, _a1, _a2, _a3) sl@0: #define SMR_TRACE4(_text, _a1, _a2, _a3, _a4) sl@0: #define SMR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) sl@0: #define SMR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) sl@0: sl@0: #define SMR_FUNC(_text) sl@0: #define SMR_FUNCE(_text) sl@0: #define SMR_FUNCR(_text) sl@0: #define SMR_FUNCR_return(_text, _r1) { return (_r1); } sl@0: sl@0: #endif sl@0: sl@0: sl@0: class TEntryExit sl@0: { sl@0: public: sl@0: inline TEntryExit(const char *aFn); sl@0: inline ~TEntryExit(); sl@0: sl@0: public: sl@0: const char* iName; sl@0: }; sl@0: sl@0: TEntryExit::TEntryExit(const char* aFn) sl@0: : iName(aFn) sl@0: { sl@0: SMR_TRACE1("--> %s " , iName); sl@0: }; sl@0: sl@0: TEntryExit::~TEntryExit() sl@0: { sl@0: SMR_TRACE1("<-- %s " , iName); sl@0: }; sl@0: sl@0: sl@0: #endif // SMR_DEBUG_H sl@0: