Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // @internalTechnology
21 #include <e32btrace.h>
27 Maximum length of a formatted string
29 const static TInt KMaxPrintfSize = 256;
32 Dummy class to toss away overflow
35 #ifndef __KERNEL_MODE__
36 class TTruncateOverflow16 : public TDes16Overflow
39 virtual void Overflow(TDes&) {};
43 Dummy class to toss away overflow
46 class TTruncateOverflow8 : public TDes8Overflow
49 virtual void Overflow(TDes8&) {};
51 #endif //__KERNEL_MODE__
54 /**@internalComponent*/
55 #define UTRACE_HEADER(aSize,aClassification,aContext,aPc) \
56 ((((aSize) + (aContext?4:0) + (aPc?4:0)) << BTrace::ESizeIndex*8) \
57 +(((aContext?BTrace::EContextIdPresent:0) | (aPc?BTrace::EPcPresent:0)) << BTrace::EFlagsIndex*8) \
58 +((aClassification) << BTrace::ECategoryIndex*8) \
59 +((0) << BTrace::ESubCategoryIndex*8))
62 /**@internalComponent*/
63 #define UTRACE_SECONDARY_0(aClassification,aModuleUid,aThreadIdPresent,aPcPresent,aPc,aFormatId) \
64 BTrace::OutFilteredPcFormatBig(UTRACE_HEADER(8,aClassification,aThreadIdPresent,aPcPresent),(TUint32)(aModuleUid),aPc,aFormatId,0,0)
66 /** @internalComponent */
67 #define UTRACE_SECONDARY_1(aClassification,aModuleUid,aThreadIdPresent,aPcPresent,aPc,aFormatId, aData1) \
68 BTrace::OutFilteredPcFormatBig(UTRACE_HEADER(8,aClassification,aThreadIdPresent,aPcPresent),(TUint32)(aModuleUid),aPc,aFormatId,&aData1,4)
74 #define UTRACE_SECONDARY_ANY(aClassification, aModuleUid, aThreadIdPresent, aPcPresent, aPc, aFormatId, aData, aDataSize) \
75 BTrace::OutFilteredPcFormatBig(UTRACE_HEADER(8,aClassification,aThreadIdPresent,aPcPresent),(TUint32)(aModuleUid),aPc,aFormatId,aData,(TInt)(aDataSize))
82 asm("mov pc, __return_address()")
84 //arm4 not implemented yet!
92 _asm mov edx, [ebp+4] \
95 //This is instead of doing "asm(mov pc, ebp+4)" as that gives warnings about registers being spilled.
97 //x86 not implemented yet!
100 /* asm("push edx"); \
101 asm("mov %0, [edx+4]": "=r" (pc)); \
110 #endif /*TRACEUTILS_H_*/