author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Sat, 20 Feb 2010 00:10:51 +0200 | |
branch | RCL_3 |
changeset 19 | 4a8fed1c0ef6 |
parent 14 | 5d2844f35677 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2008-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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// Hardware Configuration Repository Platform Independent Layer (PIL) |
|
8
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
15 |
// Contains debugging macros used in PIL and PSL source code of HCR. |
0 | 16 |
// |
17 |
||
18 |
#ifndef HCR_DEBUG_H |
|
19 |
#define HCR_DEBUG_H |
|
20 |
||
21 |
#include <e32err.h> |
|
22 |
#include <e32const.h> |
|
23 |
#include <e32def.h> |
|
24 |
#include <e32cmn.h> |
|
25 |
#include <e32des8.h> |
|
26 |
#include <kernel/kernel.h> |
|
27 |
||
28 |
// |
|
14
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
29 |
// MACROs for log statements in code |
0 | 30 |
// |
31 |
||
32 |
#ifdef _DEBUG |
|
33 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
#define HCR_LOG0(_text) __KTRACE_OPT(KHCR, Kern::Printf("=== "_text)) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
#define HCR_LOG1(_text, _a1) __KTRACE_OPT(KHCR, Kern::Printf("... "_text, (_a1))) |
0 | 36 |
|
37 |
#else |
|
38 |
||
39 |
#define HCR_LOG0(_text) |
|
40 |
#define HCR_LOG1(_text, _a1) |
|
41 |
||
42 |
#endif |
|
43 |
||
44 |
||
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
45 |
// |
14
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
46 |
// MACROs for trace statements in code |
4
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
47 |
// |
0 | 48 |
|
49 |
#ifdef HCR_TRACE |
|
50 |
||
51 |
#define HCR_TRACE0(_text) Kern::Printf((_text)) |
|
52 |
#define HCR_TRACE1(_text, _a1) Kern::Printf((_text), (_a1)) |
|
53 |
#define HCR_TRACE2(_text, _a1, _a2) Kern::Printf((_text), (_a1), (_a2)) |
|
54 |
#define HCR_TRACE3(_text, _a1, _a2, _a3) Kern::Printf((_text), (_a1), (_a2), (_a3)) |
|
55 |
#define HCR_TRACE4(_text, _a1, _a2, _a3, _a4) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4)) |
|
56 |
#define HCR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5)) |
|
57 |
#define HCR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6)) |
|
58 |
#define HCR_TRACE_RETURN(_r1) return (Kern::Printf("!-- Function exit return(%d) (%s:%d)", (_r1), __FILE__, __LINE__), _r1) |
|
59 |
#define HCR_TRACEMSG_RETURN(_s1, _r1) return (Kern::Printf("!-- "_s1" (%d)", (_r1)), _r1) |
|
60 |
#define HCR_FUNC(_text) TEntryExit _entryexit(_text) |
|
61 |
||
62 |
#define HCR_HEX_DUMP_ABS(_address, _length) HexDump((_address), (_length)); //Hex dump with absolute address |
|
63 |
#define HCR_HEX_DUMP_REL(_address, _length) HexDump((_address), (_length), EFalse); //Hex dump with relative (from) address |
|
64 |
||
65 |
class TEntryExit |
|
66 |
{ |
|
67 |
public: |
|
68 |
inline TEntryExit(const char *aFn); |
|
69 |
inline ~TEntryExit(); |
|
70 |
||
71 |
public: |
|
72 |
const char* iName; |
|
73 |
}; |
|
74 |
||
75 |
TEntryExit::TEntryExit(const char* aFn) |
|
76 |
: iName(aFn) |
|
77 |
{ |
|
78 |
HCR_TRACE1("--> %s " , iName); |
|
79 |
}; |
|
80 |
||
81 |
TEntryExit::~TEntryExit() |
|
82 |
{ |
|
83 |
HCR_TRACE1("<-- %s " , iName); |
|
84 |
}; |
|
85 |
||
86 |
||
87 |
void HexDump(TUint8* aStartAddress, TUint32 aLength, TBool aAbsolute = ETrue); |
|
88 |
||
89 |
||
14
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
90 |
#else |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
91 |
|
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
92 |
#define HCR_TRACE0(_text) __KTRACE_OPT(KHCR, Kern::Printf((_text))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
93 |
#define HCR_TRACE1(_text, _a1) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
94 |
#define HCR_TRACE2(_text, _a1, _a2) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
95 |
#define HCR_TRACE3(_text, _a1, _a2, _a3) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
96 |
#define HCR_TRACE4(_text, _a1, _a2, _a3, _a4) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
97 |
#define HCR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
98 |
#define HCR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6))) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
99 |
#define HCR_TRACE_RETURN(_r1) { __KTRACE_OPT(KHCR, Kern::Printf("!-- Function exit return(%d) (%s:%d)", (_r1), __FILE__, __LINE__)); return (_r1);} |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
100 |
#define HCR_TRACEMSG_RETURN(_s1, _r1) { __KTRACE_OPT(KHCR, Kern::Printf("!-- "_s1" (%d)", (_r1))); return (_r1);} |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
101 |
#define HCR_FUNC(_text) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
102 |
|
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
103 |
#define HCR_HEX_DUMP_ABS(_address, _length) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
104 |
#define HCR_HEX_DUMP_REL(_address, _length) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
105 |
|
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
106 |
#endif |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
107 |
|
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
108 |
|
0 | 109 |
#endif // HCR_DEBUG_H |
110 |