0
|
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 "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 |
//
|
|
15 |
|
|
16 |
#ifndef __CoreDumpUI_H
|
|
17 |
#define __CoreDumpUI_H
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalTechnology
|
|
22 |
@released
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include "coredumpui.hrh"
|
|
26 |
//for storing resource data
|
|
27 |
#include "coredumpuidatastructs.h"
|
|
28 |
|
|
29 |
#include <coeccntx.h>
|
|
30 |
|
|
31 |
#include <eikenv.h>
|
|
32 |
#include <eikappui.h>
|
|
33 |
#include <eikapp.h>
|
|
34 |
#include <eikdoc.h>
|
|
35 |
#include <eikmenup.h>
|
|
36 |
|
|
37 |
#include "coredumpuidialogs.h"
|
|
38 |
|
|
39 |
#include <coredumpui.rsg>
|
|
40 |
#include <eikchkbx.h>
|
|
41 |
#include <eikchlst.h>
|
|
42 |
#include <eiklbbut.h>
|
|
43 |
|
|
44 |
#include <eiklabel.h>
|
|
45 |
#include <eikcmbut.h>
|
|
46 |
|
|
47 |
#include <eikhopbt.h>
|
|
48 |
|
|
49 |
#include <eikclb.h> //for column list box
|
|
50 |
#include <eikclbd.h> // for CColumnListBoxData
|
|
51 |
|
|
52 |
// for CEikButtonGroupContainer
|
|
53 |
#include <eikbtgpc.h>
|
|
54 |
|
|
55 |
#include <eikon.hrh>
|
|
56 |
|
|
57 |
|
|
58 |
#include <e32base.h>
|
|
59 |
#include <e32cons.h>
|
|
60 |
#include <e32hal.h>
|
|
61 |
#include <e32std.h>
|
|
62 |
|
|
63 |
#include <eikedwin.h>
|
|
64 |
#include <smut.h>
|
|
65 |
#include <f32file.h>
|
|
66 |
#include <f32dbg.h>
|
|
67 |
#include <e32property.h> //KMaxPropertySize
|
|
68 |
|
|
69 |
#include <coredumpinterface.h>
|
|
70 |
|
|
71 |
|
|
72 |
_LIT(KFormatDec, "%d");
|
|
73 |
_LIT(KFormatDec64, "%ld");
|
|
74 |
_LIT(KFormatUDec,"%u");
|
|
75 |
_LIT(KFormatHex, "%x");
|
|
76 |
_LIT(KAsterisk, "*");
|
|
77 |
_LIT(KFillName, "ResMan");
|
|
78 |
_LIT(KYes, "Yes");
|
|
79 |
_LIT(KSpaces, " ");
|
|
80 |
|
|
81 |
|
|
82 |
enum TObjectsViewed
|
|
83 |
{
|
|
84 |
EObjectNone,
|
|
85 |
EObjectProcess,
|
|
86 |
EObjectThread,
|
|
87 |
EObjectPlugin,
|
|
88 |
EObjectPluginInstance,
|
|
89 |
EObjectExecutable,
|
|
90 |
EObjectCrashList
|
|
91 |
};
|
|
92 |
|
|
93 |
// Forward declarations
|
|
94 |
|
|
95 |
class CResourceAppUi;
|
|
96 |
class CResourceAppView;
|
|
97 |
class CResourceListView;
|
|
98 |
class CResourceView;
|
|
99 |
class CCrashNotifier;
|
|
100 |
//
|
|
101 |
//
|
|
102 |
// CResourceApplication
|
|
103 |
//
|
|
104 |
//
|
|
105 |
|
|
106 |
class CResourceApplication : public CEikApplication
|
|
107 |
{
|
|
108 |
private:
|
|
109 |
// Inherited from class CApaApplication
|
|
110 |
CApaDocument* CreateDocumentL();
|
|
111 |
TUid AppDllUid() const;
|
|
112 |
};
|
|
113 |
//
|
|
114 |
//
|
|
115 |
// CResourceDocument
|
|
116 |
//
|
|
117 |
//
|
|
118 |
class CResourceDocument : public CEikDocument
|
|
119 |
{
|
|
120 |
public:
|
|
121 |
static CResourceDocument* NewL(CEikApplication& aApp);
|
|
122 |
CResourceDocument(CEikApplication& aApp);
|
|
123 |
void ConstructL();
|
|
124 |
private:
|
|
125 |
// Inherited from CEikDocument
|
|
126 |
CEikAppUi* CreateAppUiL();
|
|
127 |
};
|
|
128 |
//
|
|
129 |
//
|
|
130 |
// CResourceAppUi
|
|
131 |
//
|
|
132 |
//
|
|
133 |
class CResourceAppUi : public CEikAppUi
|
|
134 |
{
|
|
135 |
public:
|
|
136 |
void ConstructL();
|
|
137 |
~CResourceAppUi();
|
|
138 |
|
|
139 |
private:
|
|
140 |
// Inherited from class CEikAppUi
|
|
141 |
void HandleCommandL(TInt aCommand);
|
|
142 |
|
|
143 |
private:
|
|
144 |
void SetCDSL(void);
|
|
145 |
void SetSCM();
|
|
146 |
void CancelCrashL(void);
|
|
147 |
|
|
148 |
private:
|
|
149 |
CResourceView* iListBoxView;
|
|
150 |
CCrashNotifier *iCrashNotifier;
|
|
151 |
};
|
|
152 |
|
|
153 |
|
|
154 |
#define KTargetString (250)
|
|
155 |
|
|
156 |
class TObservationRequest
|
|
157 |
{
|
|
158 |
public:
|
|
159 |
|
|
160 |
/** Name of the debug target */
|
|
161 |
TBuf<KTargetString> iTargetName;
|
|
162 |
|
|
163 |
/**
|
|
164 |
If the target is a thread, the name of its process
|
|
165 |
If a process, can be left empty
|
|
166 |
*/
|
|
167 |
TBuf<KTargetString> iTargetOwnerName;
|
|
168 |
|
|
169 |
static const TInt iOffset;
|
|
170 |
|
|
171 |
private:
|
|
172 |
TSglQueLink iLink;
|
|
173 |
};
|
|
174 |
|
|
175 |
//
|
|
176 |
//
|
|
177 |
// CResourceList
|
|
178 |
//
|
|
179 |
//
|
|
180 |
class CResourceList: public CCoeControl, public MCoeControlObserver
|
|
181 |
{
|
|
182 |
public:
|
|
183 |
void ConstructL(TInt aTablePosition);
|
|
184 |
~CResourceList();
|
|
185 |
RCoreDumpSession &CoreDumpInterface() { return iCoreDumpSession; }
|
|
186 |
|
|
187 |
protected:
|
|
188 |
void UpdateResourceCount(TUint aNumberOfResource) {iResourceCount = aNumberOfResource;}
|
|
189 |
void UpdateListDataL();
|
|
190 |
|
|
191 |
CCoeControl* GetListBox() const;
|
|
192 |
void SetObservedL();
|
|
193 |
void ConfigurePluginL();
|
|
194 |
void LoadPluginL();
|
|
195 |
void UnloadPluginL();
|
|
196 |
void BindPluginsL();
|
|
197 |
void ProcessCrashL();
|
|
198 |
void DeleteCrashLogL();
|
|
199 |
void DeleteEntireCrashPartitionL();
|
|
200 |
|
|
201 |
private:
|
|
202 |
void SetUpProcessTableL();
|
|
203 |
void SetUpThreadTableL();
|
|
204 |
void SetUpPluginTableL();
|
|
205 |
void SetUpExecutableTableL();
|
|
206 |
void SetUpPluginInstanceTableL();
|
|
207 |
void SetUpCrashListTableL();
|
|
208 |
void SetUpListL(); //uses single column tables
|
|
209 |
|
|
210 |
void GetResourceListL();
|
|
211 |
void AddRowL(const TUIProcessData& aProcessData);
|
|
212 |
void AddRowL(const TUIThreadData& aThreadData);
|
|
213 |
void AddRowL(const TUIPluginData& aChunkData);
|
|
214 |
void AddRowL(const TListData& aListData);
|
|
215 |
void AddRowL(const TUIExecutableData& aExeData);
|
|
216 |
void AddRowL(const TUIPluginInstanceData& aPluginInstance);
|
|
217 |
void AddRowL(const TCrashInfo& aCrashInfo);
|
|
218 |
|
|
219 |
void GetThreadListL(void);
|
|
220 |
void GetProcessListL(void);
|
|
221 |
void GetPluginListL(void);
|
|
222 |
void GetExecutableListL(void);
|
|
223 |
void GetPluginInstancesListL(void);
|
|
224 |
void GetCrashListL(void);
|
|
225 |
|
|
226 |
void EmptyList();
|
|
227 |
static void CleanupEComArray(TAny* aArray);
|
|
228 |
static void CleanupSelection(TAny *aList);
|
|
229 |
static void CleanupProcessList(TAny *aArray);
|
|
230 |
static void CleanupThreadList(TAny *aArray);
|
|
231 |
static void CleanupExecutableList(TAny *aArray);
|
|
232 |
static void CleanupPluginList(TAny *aArray);
|
|
233 |
static void CleanupCrashList(TAny* aArray);
|
|
234 |
|
|
235 |
void BuildSelectedListL(TSglQue<TObservationRequest> &aSelectedList);
|
|
236 |
void SetObservedProcessesL();
|
|
237 |
void SetObservedThreadsL();
|
|
238 |
void SetObservedExecutablesL();
|
|
239 |
|
|
240 |
TCrashInfo* GetCrashInfoL(const TInt aCrashId);
|
|
241 |
|
|
242 |
TInt GetNumberFormattersL(TUid& aUid);
|
|
243 |
TInt GetNumberWritersL(TUid& aUid);
|
|
244 |
|
|
245 |
RArray<TInt>* GetMarkedCrashIDsFromUIL();
|
|
246 |
|
|
247 |
CEikColumnListBox* iListBox;
|
|
248 |
CTextListBoxModel* iModel;
|
|
249 |
MDesCArray* iTextArray;
|
|
250 |
CDesCArray* iListBoxItems;
|
|
251 |
CColumnListBoxData* iListBoxData;
|
|
252 |
RCoreDumpSession iCoreDumpSession;
|
|
253 |
RBuf iRowItem;
|
|
254 |
|
|
255 |
protected:
|
|
256 |
TUIProcessData iProcessData;
|
|
257 |
TUIThreadData iThreadData;
|
|
258 |
TUIPluginData iPluginData;
|
|
259 |
TUIPluginInstanceData iPluginInstanceData;
|
|
260 |
TUIExecutableData iExeData;
|
|
261 |
|
|
262 |
TInt iBorder;
|
|
263 |
TUint iResourceCount; // Count of number of items in table
|
|
264 |
TBuf<RProperty::KMaxPropertySize> iCrashProgress; //crash progress state
|
|
265 |
TObjectsViewed iObjectsViewed; // What view is showing
|
|
266 |
|
|
267 |
private:
|
|
268 |
RCrashInfoPointerList iCrashList; //what crashes we have stored in the log
|
|
269 |
};
|
|
270 |
|
|
271 |
//
|
|
272 |
//
|
|
273 |
// CResourceView
|
|
274 |
//
|
|
275 |
//
|
|
276 |
class CResourceView : public CResourceList
|
|
277 |
{
|
|
278 |
public:
|
|
279 |
static CResourceView* NewL(const TRect& aRect, CResourceAppUi* aAppUi);
|
|
280 |
|
|
281 |
~CResourceView();
|
|
282 |
|
|
283 |
void SetCurrentObjects(TObjectsViewed aViewed)
|
|
284 |
{iObjectsViewed = aViewed;};
|
|
285 |
|
|
286 |
void UpdateViewL();
|
|
287 |
void UpdateCrashProgressL();
|
|
288 |
|
|
289 |
TDes& CrashProgress();
|
|
290 |
|
|
291 |
private:
|
|
292 |
// Private constructor to force NewL
|
|
293 |
CResourceView();
|
|
294 |
void ConstructL(const TRect& aRect, CResourceAppUi* aAppUi);
|
|
295 |
void InvalidateView(void) const;
|
|
296 |
void UpdateTitleL(void);
|
|
297 |
|
|
298 |
protected:
|
|
299 |
|
|
300 |
// Inherited from CCoeControl
|
|
301 |
virtual TInt CountComponentControls() const;
|
|
302 |
virtual CCoeControl* ComponentControl(TInt aIndex) const;
|
|
303 |
virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
|
|
304 |
|
|
305 |
private:
|
|
306 |
|
|
307 |
// Inherited from CCoeControl
|
|
308 |
void Draw(const TRect& /*aRect*/) const;
|
|
309 |
|
|
310 |
private:
|
|
311 |
|
|
312 |
CResourceAppUi* iAppUi;
|
|
313 |
|
|
314 |
// State Data
|
|
315 |
TBuf<RProperty::KMaxPropertySize> iTitle; // Title above table
|
|
316 |
// Controls
|
|
317 |
CEikCommandButton* iCommandButton;
|
|
318 |
CEikCommandButton* iObserveButton;
|
|
319 |
CEikCommandButton* iLoadButton;
|
|
320 |
};
|
|
321 |
|
|
322 |
#endif
|
|
323 |
|