1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "HelloTraceExample.h" |
|
21 #include "HelloTraceTypes.h" |
|
22 #include "HelloTraceInterface.h" |
|
23 #include "HelloTraceFn.h" |
|
24 #include "HelloTracePanic.h" |
|
25 |
|
26 #include "OstTraceDefinitions.h" |
|
27 #ifdef OST_TRACE_COMPILER_IN_USE |
|
28 #include "HelloTraceExampleTraces.h" |
|
29 #endif |
|
30 |
|
31 EXPORT_C void HelloTraceExample::JustTypes() |
|
32 { |
|
33 OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_JUSTTYPES, "*********************************************** " ); |
|
34 |
|
35 HelloTraceTypes::SignedIntegers(); |
|
36 HelloTraceTypes::UnsignedIntegers(); |
|
37 HelloTraceTypes::Descriptors(); |
|
38 } |
|
39 |
|
40 EXPORT_C void HelloTraceExample::Interface() |
|
41 { |
|
42 OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_INTERFACE, "*********************************************** " ); |
|
43 |
|
44 TVersion version = CHelloTraceInterface::Version(); |
|
45 if (version.iMajor >= 1) |
|
46 { |
|
47 CHelloTraceInterface* example = CHelloTraceInterface::NewLC(); |
|
48 example->AddCharL('H'); |
|
49 example->AddCharL('e'); |
|
50 example->AddCharL('l'); |
|
51 example->AddCharL('l'); |
|
52 example->AddCharL('o'); |
|
53 example->AddCharL('T'); |
|
54 example->RemoveLast(); |
|
55 example->AddCharL(' '); |
|
56 example->AddCharL('T'); |
|
57 example->AddCharL('r'); |
|
58 example->AddCharL('a'); |
|
59 example->AddCharL('c'); |
|
60 example->AddCharL('e'); |
|
61 example->AddCharL('!'); |
|
62 CleanupStack::PopAndDestroy(example); |
|
63 } |
|
64 else |
|
65 { |
|
66 OstTrace0( TRACE_ERROR, HELLOTRACEEXAMPLE_UNSUPPORTED_VERSION, "Unsupported version!"); |
|
67 } |
|
68 } |
|
69 |
|
70 EXPORT_C void HelloTraceExample::FnEntryExit() |
|
71 { |
|
72 OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_FNENTRYEXIT, "*********************************************** " ); |
|
73 |
|
74 CHelloTraceFn* example = CHelloTraceFn::NewLC(); |
|
75 CIdle* idle = CIdle::NewL(CActive::EPriorityIdle); |
|
76 CleanupStack::PushL(idle); |
|
77 |
|
78 CHelloTraceFn::StaticOutputsParamsL(1); |
|
79 |
|
80 example->Simple(); |
|
81 example->OutputsParams(2, CHelloTraceFn::EExample1); |
|
82 example->OutputsParams(3, CHelloTraceFn::EExample2); |
|
83 example->OutputsSignedIntegers(-4, -5, -6, -7); |
|
84 example->OutputsUnsignedIntegers(8, 9, 10, 11); |
|
85 example->OutputsTIntReturnValue(); |
|
86 example->OutputsTInt64ReturnValue(); |
|
87 example->OutputsTFnEnumReturnValue(); |
|
88 example->OutputsUnknownPtrType(idle); |
|
89 example->OutputsUnknownRefType(*idle); |
|
90 #ifdef _DEBUG |
|
91 example->PreProcessedFn(12); |
|
92 #else |
|
93 example->PreProcessedFn(); |
|
94 #endif |
|
95 example->OutputMissingParams(13, 14, 15); |
|
96 |
|
97 CleanupStack::PopAndDestroy(idle); |
|
98 CleanupStack::PopAndDestroy(example); |
|
99 } |
|
100 |
|
101 EXPORT_C void HelloTraceExample::PanicTrace() |
|
102 { |
|
103 OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_PANIC, "*********************************************** " ); |
|
104 |
|
105 Panic(EHelloTraceDllExamplePanic); |
|
106 } |
|