|
1 /* |
|
2 * Copyright (c) 2009 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 #include <memspy/api/memspyapicodesegment.h> |
|
19 #include <memspy/engine/memspycodesegmentdata.h> |
|
20 |
|
21 |
|
22 EXPORT_C CMemSpyApiCodeSegment::~CMemSpyApiCodeSegment() |
|
23 { |
|
24 delete iCodeSegmentData; |
|
25 } |
|
26 |
|
27 EXPORT_C const TDesC& CMemSpyApiCodeSegment::Name() const |
|
28 { |
|
29 return iCodeSegmentData->iName; |
|
30 } |
|
31 |
|
32 EXPORT_C TInt CMemSpyApiCodeSegment::CodeSize() const |
|
33 { |
|
34 return iCodeSegmentData->iCodeSize; |
|
35 } |
|
36 |
|
37 EXPORT_C TInt CMemSpyApiCodeSegment::TotalDataSize() const |
|
38 { |
|
39 return iCodeSegmentData->iTotalDataSize; |
|
40 } |
|
41 |
|
42 EXPORT_C TInt CMemSpyApiCodeSegment::TextSize() const |
|
43 { |
|
44 return iCodeSegmentData->iTextSize; |
|
45 } |
|
46 |
|
47 EXPORT_C TInt CMemSpyApiCodeSegment::DataSize() const |
|
48 { |
|
49 return iCodeSegmentData->iDataSize; |
|
50 } |
|
51 |
|
52 EXPORT_C TInt CMemSpyApiCodeSegment::BssSize() const |
|
53 { |
|
54 return iCodeSegmentData->iBssSize; |
|
55 } |
|
56 |
|
57 EXPORT_C TUidType CMemSpyApiCodeSegment::Uids() const |
|
58 { |
|
59 return iCodeSegmentData->iUids; |
|
60 } |
|
61 |
|
62 EXPORT_C TUint32 CMemSpyApiCodeSegment::ModuleVersion() const |
|
63 { |
|
64 return iCodeSegmentData->iModuleVersion; |
|
65 } |
|
66 |
|
67 EXPORT_C TUint32 CMemSpyApiCodeSegment::SID() const |
|
68 { |
|
69 return iCodeSegmentData->iSecureId; |
|
70 } |
|
71 |
|
72 EXPORT_C TUint32 CMemSpyApiCodeSegment::VID() const |
|
73 { |
|
74 return iCodeSegmentData->iVendorId; |
|
75 } |
|
76 |
|
77 EXPORT_C TUint32 CMemSpyApiCodeSegment::EntryPtVeneer() const // address of first instruction to be called |
|
78 { |
|
79 return iCodeSegmentData->iEntryPtVeneer; |
|
80 } |
|
81 |
|
82 EXPORT_C TUint32 CMemSpyApiCodeSegment::FileEntryPoint() const // address of entry point within this code segment |
|
83 { |
|
84 return iCodeSegmentData->iFileEntryPoint; |
|
85 } |
|
86 |
|
87 EXPORT_C TInt CMemSpyApiCodeSegment::DepCount() const |
|
88 { |
|
89 return iCodeSegmentData->iDepCount; |
|
90 } |
|
91 |
|
92 EXPORT_C TUint32 CMemSpyApiCodeSegment::CodeLoadAddress() const // 0 for RAM loaded code, else pointer to TRomImageHeader |
|
93 { |
|
94 return iCodeSegmentData->iCodeLoadAddress; |
|
95 } |
|
96 |
|
97 EXPORT_C TUint32 CMemSpyApiCodeSegment::DataLoadAddress() const |
|
98 { |
|
99 return iCodeSegmentData->iDataLoadAddress; |
|
100 } |
|
101 |
|
102 EXPORT_C TUint32 CMemSpyApiCodeSegment::Capabilities1() const |
|
103 { |
|
104 return iCodeSegmentData->iCapabilities1; |
|
105 } |
|
106 |
|
107 EXPORT_C TUint32 CMemSpyApiCodeSegment::Capabilities2() const |
|
108 { |
|
109 return iCodeSegmentData->iCapabilities2; |
|
110 } |
|
111 |
|
112 CMemSpyApiCodeSegment::CMemSpyApiCodeSegment() : iCodeSegmentData(0) |
|
113 { |
|
114 } |
|
115 |
|
116 void CMemSpyApiCodeSegment::ConstructL(const TMemSpyCodeSegmentData& aData) |
|
117 { |
|
118 iCodeSegmentData = new (ELeave) TMemSpyCodeSegmentData(aData); |
|
119 } |
|
120 |
|
121 CMemSpyApiCodeSegment* CMemSpyApiCodeSegment::NewL(const TMemSpyCodeSegmentData& aData) |
|
122 { |
|
123 CMemSpyApiCodeSegment* self = CMemSpyApiCodeSegment::NewLC(aData); |
|
124 CleanupStack::Pop(self); |
|
125 return (self); |
|
126 } |
|
127 |
|
128 CMemSpyApiCodeSegment* CMemSpyApiCodeSegment::NewLC(const TMemSpyCodeSegmentData& aData) |
|
129 { |
|
130 CMemSpyApiCodeSegment* self = new (ELeave) CMemSpyApiCodeSegment; |
|
131 CleanupStack::PushL(self); |
|
132 self->ConstructL(aData); |
|
133 return (self); |
|
134 } |