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.
24 #include <e32btrace.h>
28 Maximum length of a formatted string
30 const static TInt KMaxPrintfSize = 256;
33 Dummy class to toss away overflow
37 #ifndef __KERNEL_MODE__
38 class TTruncateOverflow16 : public TDes16Overflow
41 virtual void Overflow(TDes&) {};
45 Dummy class to toss away overflow
49 class TTruncateOverflow8 : public TDes8Overflow
52 virtual void Overflow(TDes8&) {};
54 #endif //__KERNEL_MODE__
60 #define OST_HEADER(aSize,aGroupId,aContext,aPc) \
61 ((((aSize) + (aContext?4:0) + (aPc?4:0)) << BTrace::ESizeIndex*8) \
62 +(((aContext?BTrace::EContextIdPresent:0) | (aPc?BTrace::EPcPresent:0)) << BTrace::EFlagsIndex*8) \
63 +((aGroupId) << BTrace::ECategoryIndex*8) \
64 +((0) << BTrace::ESubCategoryIndex*8))
70 #define OST_SECONDARY_0(aGroupId,aComponentId,aThreadIdPresent,aPcPresent,aPc,aTraceId) \
71 BTrace::OutFilteredPcFormatBig(OST_HEADER(8,aGroupId,aThreadIdPresent,aPcPresent),(TUint32)(aComponentId),aPc,aTraceId,0,0)
76 #define OST_SECONDARY_1(aGroupId,aComponentId,aThreadIdPresent,aPcPresent,aPc,aTraceId, aData1) \
77 BTrace::OutFilteredPcFormatBig(OST_HEADER(8,aGroupId,aThreadIdPresent,aPcPresent),(TUint32)(aComponentId),aPc,aTraceId,&aData1,4)
82 #define OST_SECONDARY_ANY(aGroupId, aComponentId, aThreadIdPresent, aPcPresent, aPc, aTraceId, aData, aDataSize) \
83 BTrace::OutFilteredPcFormatBig(OST_HEADER(8,aGroupId,aThreadIdPresent,aPcPresent),(TUint32)(aComponentId),aPc,aTraceId,aData,(TInt)(aDataSize))
90 asm("mov pc, __return_address()")
92 //arm4 not implemented yet!
100 _asm mov edx, [ebp+4] \
103 //This is instead of doing "asm(mov pc, ebp+4)" as that gives warnings about registers being spilled.
105 //x86 not implemented yet!
108 /* asm("push edx"); \
109 asm("mov %0, [edx+4]": "=r" (pc)); \
117 #endif /*TRACEUTILS_H_*/