51
|
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 "MemSpyViewKernelObjects.h"
|
|
19 |
|
|
20 |
// System includes
|
|
21 |
#include <eikspane.h>
|
|
22 |
#include <aknnavide.h>
|
|
23 |
#include <akntabgrp.h>
|
|
24 |
#include <eikclbd.h>
|
|
25 |
#include <AknQueryDialog.h>
|
|
26 |
#include <aknnotewrappers.h>
|
|
27 |
#include <apgwgnam.h>
|
|
28 |
#include <aknmessagequerydialog.h>
|
53
|
29 |
#include <aknwaitdialog.h>
|
51
|
30 |
|
|
31 |
// Engine includes
|
|
32 |
#include <memspy/engine/memspyengine.h>
|
|
33 |
#include <memspy/engine/memspyengineobjectprocess.h>
|
|
34 |
#include <memspy/engine/memspyengineobjectthread.h>
|
|
35 |
#include <memspy/engine/memspyengineobjectcontainer.h>
|
|
36 |
#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
|
|
37 |
#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
|
|
38 |
#include <memspy/engine/memspyenginehelperkernelcontainers.h>
|
|
39 |
#include <memspy/engine/memspyenginehelperserver.h>
|
|
40 |
#include <memspy/engine/memspyenginehelpercondvar.h>
|
|
41 |
|
|
42 |
#include <memspysession.h>
|
|
43 |
|
|
44 |
// User includes
|
|
45 |
#include "MemSpyUiUtils.h"
|
|
46 |
#include "MemSpyViewKernel.h"
|
|
47 |
#include "MemSpyContainerObserver.h"
|
|
48 |
#include "MemSpyViewKernelContainers.h"
|
|
49 |
|
|
50 |
const TInt KMaxInfoLength = 128;
|
|
51 |
|
|
52 |
/*
|
|
53 |
CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
|
|
54 |
: CMemSpyViewBase( aEngine, aObserver ),
|
|
55 |
iObjectType( aObjectType ),
|
|
56 |
iCurrItemIndex( KErrNotFound )
|
|
57 |
{
|
|
58 |
}
|
|
59 |
*/
|
|
60 |
CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
|
|
61 |
: CMemSpyViewBase( aSession, aObserver ),
|
|
62 |
iObjectType( aObjectType ),
|
|
63 |
iCurrItemIndex( KErrNotFound )
|
|
64 |
{
|
|
65 |
}
|
|
66 |
|
|
67 |
|
|
68 |
CMemSpyViewKernelObjects::~CMemSpyViewKernelObjects()
|
|
69 |
{
|
|
70 |
if ( iNavContainer && iNavDecorator )
|
|
71 |
{
|
|
72 |
iNavContainer->Pop( iNavDecorator );
|
|
73 |
delete iNavDecorator;
|
|
74 |
}
|
|
75 |
delete iItems;
|
|
76 |
delete iObjectList;
|
53
|
77 |
|
|
78 |
if( iWaitDialog )
|
|
79 |
delete iWaitDialog;
|
|
80 |
|
|
81 |
for (TInt i=0; i<iKernelObjectItems.Count(); i++)
|
|
82 |
{
|
|
83 |
delete iKernelObjectItems[i];
|
|
84 |
}
|
|
85 |
|
|
86 |
iKernelObjectItems.Close();
|
51
|
87 |
}
|
|
88 |
|
|
89 |
|
|
90 |
void CMemSpyViewKernelObjects::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
|
|
91 |
{
|
53
|
92 |
iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), ETrue);
|
|
93 |
iWaitDialog->PrepareLC( R_MEMSPY_WAIT_NOTE );
|
|
94 |
iWaitDialog->RunLD();
|
|
95 |
|
51
|
96 |
_LIT( KTitle, "Kernel Objects" );
|
|
97 |
SetTitleL( KTitle );
|
|
98 |
iItems = new(ELeave) CDesCArrayFlat(5);
|
|
99 |
//
|
|
100 |
CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
|
|
101 |
CreateTabsL();
|
53
|
102 |
|
|
103 |
iWaitDialog->ProcessFinishedL();
|
51
|
104 |
}
|
|
105 |
|
|
106 |
|
|
107 |
CEikListBox* CMemSpyViewKernelObjects::ConstructListBoxL()
|
|
108 |
{
|
|
109 |
delete iListBox;
|
|
110 |
iListBox = NULL;
|
|
111 |
CAknSingleStyleListBox* listbox = new (ELeave) CAknSingleStyleListBox();
|
|
112 |
iListBox = listbox;
|
|
113 |
listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
|
|
114 |
listbox->SetContainerWindowL( *this );
|
|
115 |
listbox->CreateScrollBarFrameL( ETrue );
|
|
116 |
SetListBoxModelL();
|
|
117 |
listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
|
|
118 |
listbox->SetListBoxObserver( this );
|
|
119 |
listbox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
|
|
120 |
listbox->SetObserver( this );
|
|
121 |
return listbox;
|
|
122 |
}
|
|
123 |
|
|
124 |
|
|
125 |
void CMemSpyViewKernelObjects::RefreshL()
|
53
|
126 |
{
|
51
|
127 |
SetListBoxModelL();
|
53
|
128 |
CMemSpyViewBase::RefreshL();
|
51
|
129 |
}
|
|
130 |
|
|
131 |
|
|
132 |
TMemSpyViewType CMemSpyViewKernelObjects::ViewType() const
|
|
133 |
{
|
|
134 |
return EMemSpyViewTypeKernelObjects;
|
|
135 |
}
|
|
136 |
|
|
137 |
|
|
138 |
CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareParentViewL()
|
|
139 |
{
|
|
140 |
if ( iNaviPane && iNavDecorator )
|
|
141 |
{
|
|
142 |
iNaviPane->Pop( iNavDecorator );
|
|
143 |
delete iNavDecorator;
|
|
144 |
iNavDecorator = NULL;
|
|
145 |
}
|
|
146 |
//CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
|
|
147 |
CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iMemSpySession, iObserver );
|
|
148 |
CleanupStack::PushL( parent );
|
|
149 |
parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
|
|
150 |
CleanupStack::Pop( parent );
|
|
151 |
return parent;
|
|
152 |
}
|
|
153 |
|
|
154 |
|
|
155 |
CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareChildViewL()
|
|
156 |
{
|
|
157 |
CMemSpyViewBase* child = NULL;
|
|
158 |
if ( iListBox &&
|
|
159 |
iListBox->Model()->NumberOfItems() &&
|
|
160 |
iListBox->CurrentItemIndex() > KErrNotFound )
|
|
161 |
{
|
|
162 |
DetailsL();
|
|
163 |
}
|
|
164 |
return child;
|
|
165 |
}
|
|
166 |
|
|
167 |
|
|
168 |
void CMemSpyViewKernelObjects::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
|
|
169 |
{
|
|
170 |
if ( aResourceId == R_MEMSPY_MENUPANE )
|
|
171 |
{
|
|
172 |
if ( iObjectType > EMemSpyDriverContainerTypeProcess )
|
|
173 |
{
|
|
174 |
// Display Terminate, Switch to, End and Panic
|
|
175 |
// commands only for Threads and processes
|
|
176 |
aMenuPane->SetItemDimmed( EMemSpyCmdKernelObjects, ETrue );
|
|
177 |
}
|
|
178 |
}
|
|
179 |
}
|
|
180 |
|
|
181 |
|
|
182 |
void CMemSpyViewKernelObjects::SetListBoxModelL()
|
|
183 |
{
|
|
184 |
//_LIT( KLineFormatSpec, "\t%S" );
|
|
185 |
_LIT( KTab, "\t" );
|
|
186 |
|
53
|
187 |
for (TInt i=0; i<iKernelObjectItems.Count(); i++)
|
|
188 |
{
|
|
189 |
delete iKernelObjectItems[i];
|
|
190 |
}
|
51
|
191 |
iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
|
|
192 |
|
53
|
193 |
CDesC16ArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() + 1 ); //array for formated items, +1 added there for 0 case - creating 0-sized array panics
|
|
194 |
CleanupStack::PushL( model );
|
51
|
195 |
|
|
196 |
for ( TInt i = 0; i < iKernelObjectItems.Count(); i++ )
|
|
197 |
{
|
|
198 |
HBufC* tempName = HBufC::NewL( iKernelObjectItems[i]->Name().Length() + 16 );
|
|
199 |
CleanupStack::PushL( tempName );
|
|
200 |
TPtr tempNamePtr( tempName->Des() );
|
|
201 |
tempNamePtr.Copy( KTab );
|
|
202 |
|
|
203 |
TBuf<KMaxName> temp;
|
|
204 |
temp.Copy(iKernelObjectItems[i]->Name());
|
|
205 |
tempNamePtr.Append( temp );
|
53
|
206 |
model->AppendL( tempNamePtr );
|
51
|
207 |
|
|
208 |
CleanupStack::PopAndDestroy( tempName );
|
|
209 |
}
|
|
210 |
|
|
211 |
CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
|
53
|
212 |
listbox->Model()->SetItemTextArray( model );
|
|
213 |
listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
|
|
214 |
|
|
215 |
CleanupStack::Pop( model );
|
51
|
216 |
}
|
|
217 |
|
|
218 |
|
|
219 |
TBool CMemSpyViewKernelObjects::HandleCommandL( TInt aCommand )
|
|
220 |
{
|
|
221 |
TBool handled = ETrue;
|
|
222 |
//
|
|
223 |
switch ( aCommand )
|
|
224 |
{
|
|
225 |
case EMemSpyCmdKernelObjectTerminate:
|
|
226 |
{
|
|
227 |
TRAPD( err, OnCmdTerminateL() );
|
|
228 |
if ( err )
|
|
229 |
{
|
|
230 |
CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
|
|
231 |
note->ExecuteLD( _L("Cannot terminate task") );
|
|
232 |
}
|
|
233 |
break;
|
|
234 |
}
|
|
235 |
case EMemSpyCmdKernelObjectSwitchTo:
|
|
236 |
{
|
|
237 |
TRAPD( err, OnCmdSwitchToL() );
|
|
238 |
if ( err )
|
|
239 |
{
|
|
240 |
CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
|
|
241 |
note->ExecuteLD( _L("Cannot bring to foreground") );
|
|
242 |
}
|
|
243 |
break;
|
|
244 |
}
|
|
245 |
case EMemSpyCmdKernelObjectEnd:
|
|
246 |
{
|
|
247 |
TRAPD( err, OnCmdEndL() );
|
|
248 |
if ( err )
|
|
249 |
{
|
|
250 |
CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
|
|
251 |
note->ExecuteLD( _L("Cannot end task") );
|
|
252 |
}
|
|
253 |
break;
|
|
254 |
}
|
|
255 |
case EMemSpyCmdKernelObjectPanic:
|
|
256 |
{
|
|
257 |
TRAPD( err, OnCmdPanicL() );
|
|
258 |
if ( err )
|
|
259 |
{
|
|
260 |
CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
|
|
261 |
note->ExecuteLD( _L("Cannot panic task") );
|
|
262 |
}
|
|
263 |
break;
|
|
264 |
}
|
|
265 |
default:
|
|
266 |
{
|
|
267 |
handled = CMemSpyViewBase::HandleCommandL( aCommand );
|
|
268 |
break;
|
|
269 |
}
|
|
270 |
}
|
|
271 |
//
|
|
272 |
return handled;
|
|
273 |
}
|
|
274 |
|
|
275 |
|
|
276 |
TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
|
|
277 |
{
|
|
278 |
TKeyResponse resp = EKeyWasNotConsumed;
|
|
279 |
resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );
|
|
280 |
//}
|
|
281 |
return resp;
|
|
282 |
}
|
|
283 |
|
|
284 |
void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
|
|
285 |
{
|
|
286 |
}
|
|
287 |
|
|
288 |
|
|
289 |
void CMemSpyViewKernelObjects::OnCmdTerminateL()
|
|
290 |
{
|
|
291 |
switch ( iObjectType )
|
|
292 |
{
|
|
293 |
case EMemSpyDriverContainerTypeThread:
|
|
294 |
{
|
|
295 |
TBool err = EFalse;
|
|
296 |
TBool doTerminate = ETrue;
|
|
297 |
|
|
298 |
TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
|
|
299 |
|
|
300 |
iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
|
|
301 |
|
|
302 |
if( err )
|
|
303 |
{
|
|
304 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
305 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
306 |
|
|
307 |
if ( doTerminate )
|
|
308 |
{
|
|
309 |
iMemSpySession.EndThreadL( id, ETerminate );
|
|
310 |
RefreshL();
|
|
311 |
}
|
|
312 |
}
|
|
313 |
break;
|
|
314 |
}
|
|
315 |
case EMemSpyDriverContainerTypeProcess:
|
|
316 |
{
|
|
317 |
TBool err = EFalse;
|
|
318 |
TBool doTerminate = ETrue;
|
|
319 |
TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
|
|
320 |
iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
|
|
321 |
|
|
322 |
if( err )
|
|
323 |
{
|
|
324 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
325 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
326 |
|
|
327 |
if( doTerminate )
|
|
328 |
{
|
|
329 |
iMemSpySession.EndProcessL( id, ETerminate );
|
|
330 |
RefreshL();
|
|
331 |
}
|
|
332 |
}
|
|
333 |
break;
|
|
334 |
}
|
|
335 |
default:
|
|
336 |
{
|
|
337 |
// Programming error
|
|
338 |
__ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
|
|
339 |
}
|
|
340 |
}
|
|
341 |
}
|
|
342 |
|
|
343 |
|
|
344 |
void CMemSpyViewKernelObjects::OnCmdSwitchToL()
|
|
345 |
{
|
|
346 |
TBool brought = EFalse;
|
|
347 |
/*
|
|
348 |
TInt wgCount;
|
|
349 |
RWsSession wsSession;
|
|
350 |
User::LeaveIfError( wsSession.Connect() );
|
|
351 |
CleanupClosePushL( wsSession );
|
|
352 |
User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
|
|
353 |
RArray<RWsSession::TWindowGroupChainInfo> wgArray;
|
|
354 |
CleanupClosePushL( wgArray );
|
|
355 |
User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
|
|
356 |
TApaTask task( wsSession );
|
|
357 |
TBool brought( EFalse );
|
|
358 |
TInt wgId( KErrNotFound );
|
|
359 |
TThreadId threadId;
|
|
360 |
*/
|
|
361 |
switch ( iObjectType )
|
|
362 |
{
|
|
363 |
case EMemSpyDriverContainerTypeThread:
|
|
364 |
{
|
|
365 |
TThreadId currentThreadId( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
|
|
366 |
TInt error = iMemSpySession.SwitchToThread( currentThreadId, brought );
|
|
367 |
/*
|
|
368 |
TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
|
|
369 |
|
|
370 |
// loop trough all window groups and see if a thread id matches
|
|
371 |
while( !brought && wgCount-- )
|
|
372 |
{
|
|
373 |
wgId = wgArray[wgCount].iId;
|
|
374 |
User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
|
|
375 |
if ( threadId == currentThreadId )
|
|
376 |
{
|
|
377 |
CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
|
|
378 |
task.SetWgId( wgId );
|
|
379 |
if ( !wgName->Hidden() && task.Exists() )
|
|
380 |
{
|
|
381 |
task.BringToForeground();
|
|
382 |
brought = ETrue;
|
|
383 |
}
|
|
384 |
CleanupStack::PopAndDestroy( wgName );
|
|
385 |
}
|
|
386 |
}
|
|
387 |
*/
|
|
388 |
break;
|
|
389 |
}
|
|
390 |
case EMemSpyDriverContainerTypeProcess:
|
|
391 |
{
|
|
392 |
TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
|
|
393 |
TInt error = iMemSpySession.SwitchToProcess( id, brought );
|
|
394 |
/*
|
|
395 |
//CMemSpyEngineObjectContainer& container = iEngine.Container();
|
|
396 |
//TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
|
|
397 |
//CMemSpyProcess& process = container.ProcessByIdL( id );
|
|
398 |
|
|
399 |
TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
|
|
400 |
|
|
401 |
|
|
402 |
// loop trough threads in a process
|
|
403 |
for ( TInt i = 0; i < process.MdcaCount(); i++ )
|
|
404 |
{
|
|
405 |
TInt wgCountLocal = wgCount;
|
|
406 |
|
|
407 |
// loop trough all window groups and see if a thread id matches
|
|
408 |
while( !brought && wgCountLocal-- )
|
|
409 |
{
|
|
410 |
wgId = wgArray[wgCountLocal].iId;
|
|
411 |
User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
|
|
412 |
if ( threadId == process.At( i ).Id() )
|
|
413 |
{
|
|
414 |
CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
|
|
415 |
task.SetWgId( wgId );
|
|
416 |
if ( !wgName->Hidden() && task.Exists() )
|
|
417 |
{
|
|
418 |
task.BringToForeground();
|
|
419 |
brought = ETrue;
|
|
420 |
}
|
|
421 |
CleanupStack::PopAndDestroy( wgName );
|
|
422 |
}
|
|
423 |
}
|
|
424 |
}
|
|
425 |
*/
|
|
426 |
break;
|
|
427 |
}
|
|
428 |
default:
|
|
429 |
{
|
|
430 |
// Programming error
|
|
431 |
__ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
|
|
432 |
}
|
|
433 |
}
|
|
434 |
if ( !brought )
|
|
435 |
{
|
|
436 |
// Error handling in HandleCommandL
|
|
437 |
User::Leave( KErrGeneral );
|
|
438 |
}
|
|
439 |
CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession
|
|
440 |
}
|
|
441 |
|
|
442 |
|
|
443 |
void CMemSpyViewKernelObjects::OnCmdEndL()
|
|
444 |
{
|
|
445 |
switch ( iObjectType )
|
|
446 |
{
|
|
447 |
case EMemSpyDriverContainerTypeThread:
|
|
448 |
{
|
|
449 |
TBool err = EFalse;
|
|
450 |
TBool doTerminate = ETrue;
|
|
451 |
|
|
452 |
TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
|
|
453 |
iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
|
|
454 |
|
|
455 |
if( err )
|
|
456 |
{
|
|
457 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
458 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
459 |
|
|
460 |
if ( doTerminate )
|
|
461 |
{
|
|
462 |
iMemSpySession.EndThreadL( id, EKill );
|
|
463 |
RefreshL();
|
|
464 |
}
|
|
465 |
}
|
|
466 |
|
|
467 |
|
|
468 |
/*
|
|
469 |
CMemSpyEngineObjectContainer& container = iEngine.Container();
|
|
470 |
TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
|
|
471 |
|
|
472 |
// Try to find the thread in question...
|
|
473 |
CMemSpyProcess* process = NULL;
|
|
474 |
CMemSpyThread* thread = NULL;
|
|
475 |
User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
|
|
476 |
|
|
477 |
if ( thread )
|
|
478 |
{
|
|
479 |
//
|
|
480 |
if ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
|
|
481 |
{
|
|
482 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
483 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
484 |
}
|
|
485 |
//
|
|
486 |
if ( doTerminate )
|
|
487 |
{
|
|
488 |
thread->KillL();
|
|
489 |
}
|
|
490 |
}
|
|
491 |
|
|
492 |
RefreshL();
|
|
493 |
*/
|
|
494 |
break;
|
|
495 |
}
|
|
496 |
case EMemSpyDriverContainerTypeProcess:
|
|
497 |
{
|
|
498 |
TBool err = EFalse;
|
|
499 |
TBool doTerminate = ETrue;
|
|
500 |
TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
|
|
501 |
iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
|
|
502 |
|
|
503 |
if( err )
|
|
504 |
{
|
|
505 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
506 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
507 |
|
|
508 |
if( doTerminate )
|
|
509 |
{
|
|
510 |
iMemSpySession.EndProcessL( id, EKill);
|
|
511 |
RefreshL();
|
|
512 |
}
|
|
513 |
}
|
|
514 |
|
|
515 |
/*
|
|
516 |
TBool doTerminate = ETrue;
|
|
517 |
// Obtain the process that corresponds to the selected item
|
|
518 |
CMemSpyEngineObjectContainer& container = iEngine.Container();
|
|
519 |
TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
|
|
520 |
CMemSpyProcess& process = container.ProcessByIdL( id );
|
|
521 |
|
|
522 |
if ( process.IsSystemPermanent() || process.IsSystemCritical() )
|
|
523 |
{
|
|
524 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
525 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
526 |
}
|
|
527 |
if ( doTerminate )
|
|
528 |
{
|
|
529 |
process.KillL();
|
|
530 |
RefreshL();
|
|
531 |
}
|
|
532 |
*/
|
|
533 |
break;
|
|
534 |
}
|
|
535 |
default:
|
|
536 |
{
|
|
537 |
// Programming error
|
|
538 |
__ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
|
|
539 |
}
|
|
540 |
}
|
|
541 |
}
|
|
542 |
|
|
543 |
|
|
544 |
void CMemSpyViewKernelObjects::OnCmdPanicL()
|
|
545 |
{
|
|
546 |
switch ( iObjectType )
|
|
547 |
{
|
|
548 |
case EMemSpyDriverContainerTypeThread:
|
|
549 |
{
|
|
550 |
TBool err = EFalse;
|
|
551 |
TBool doTerminate = ETrue;
|
|
552 |
|
|
553 |
TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
|
|
554 |
iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
|
|
555 |
|
|
556 |
if( err )
|
|
557 |
{
|
|
558 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
559 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
560 |
|
|
561 |
if ( doTerminate )
|
|
562 |
{
|
|
563 |
iMemSpySession.EndThreadL( id, EPanic );
|
|
564 |
RefreshL();
|
|
565 |
}
|
|
566 |
}
|
|
567 |
|
|
568 |
break;
|
|
569 |
}
|
|
570 |
case EMemSpyDriverContainerTypeProcess:
|
|
571 |
{
|
|
572 |
TBool err = EFalse;
|
|
573 |
TBool doTerminate = ETrue;
|
|
574 |
TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
|
|
575 |
iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
|
|
576 |
|
|
577 |
if( err )
|
|
578 |
{
|
|
579 |
CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
|
|
580 |
doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
|
|
581 |
|
|
582 |
if( doTerminate )
|
|
583 |
{
|
|
584 |
iMemSpySession.EndProcessL( id, EPanic );
|
|
585 |
RefreshL();
|
|
586 |
}
|
|
587 |
}
|
|
588 |
|
|
589 |
break;
|
|
590 |
}
|
|
591 |
default:
|
|
592 |
{
|
|
593 |
// Programming error
|
|
594 |
__ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
|
|
595 |
}
|
|
596 |
}
|
|
597 |
}
|
|
598 |
|
|
599 |
|
|
600 |
void CMemSpyViewKernelObjects::CreateTabsL()
|
|
601 |
{
|
|
602 |
TMemSpyDriverContainerType type = iObjectType;
|
|
603 |
const TPtrC pType( MemSpyUiUtils::TypeAsString( type ) );
|
|
604 |
|
|
605 |
CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
|
|
606 |
TUid uid;
|
|
607 |
uid.iUid = EEikStatusPaneUidNavi;
|
|
608 |
iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
|
|
609 |
iNavDecorator=iNaviPane->CreateMessageLabelL( pType );
|
|
610 |
iNaviPane->PushL(*iNavDecorator);
|
|
611 |
}
|
|
612 |
|
|
613 |
|
|
614 |
void CMemSpyViewKernelObjects::DetailsL()
|
|
615 |
{
|
|
616 |
HBufC* messageBuf = HBufC::NewLC( 40960 );
|
|
617 |
TPtr messagePtr = messageBuf->Des();
|
|
618 |
|
|
619 |
//const TMemSpyDriverHandleInfoGeneric& selectedObject = iObjectList->At( iListBox->CurrentItemIndex() );
|
|
620 |
//iKernelObjectItems[iListBox->CurrentItemIndex];
|
|
621 |
|
|
622 |
// General attributes:
|
|
623 |
TFullName name;
|
|
624 |
name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameDetail() );
|
|
625 |
AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
|
|
626 |
name.Zero();
|
|
627 |
name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
|
|
628 |
AppendFormatString( messagePtr, _L("FullName: %S\n"), &name );
|
|
629 |
name.Zero();
|
|
630 |
AppendFormatString( messagePtr, _L("AccessCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AccessCount() );
|
|
631 |
AppendFormatString( messagePtr, _L("UniqueID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UniqueID() );
|
|
632 |
AppendFormatString( messagePtr, _L("Protection: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Protection() );
|
|
633 |
AppendFormatString( messagePtr, _L("OwnrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfKernelOwner() );
|
|
634 |
AppendFormatString( messagePtr, _L("KernelAddr: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Handle() );
|
|
635 |
|
|
636 |
// Object type specific attributes:
|
|
637 |
switch ( iKernelObjectItems[iListBox->CurrentItemIndex()]->Type() )
|
|
638 |
{
|
|
639 |
case EMemSpyDriverContainerTypeUnknown:
|
|
640 |
{
|
|
641 |
break;
|
|
642 |
}
|
|
643 |
case EMemSpyDriverContainerTypeThread:
|
|
644 |
{
|
|
645 |
AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
|
|
646 |
AppendFormatString( messagePtr, _L("ThreadID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
|
|
647 |
AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
|
|
648 |
TFullName procName;
|
|
649 |
procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
650 |
AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
|
|
651 |
procName.Zero();
|
|
652 |
break;
|
|
653 |
}
|
|
654 |
case EMemSpyDriverContainerTypeProcess:
|
|
655 |
{
|
|
656 |
AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
|
|
657 |
AppendFormatString( messagePtr, _L("CreatorId: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->CreatorId() );
|
|
658 |
AppendFormatString( messagePtr, _L("Attributes: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
|
|
659 |
AppendFormatString( messagePtr, _L("StckChnk: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfDataBssStackChunk() );
|
|
660 |
AppendFormatString( messagePtr, _L("ProcessID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
|
|
661 |
AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
|
|
662 |
AppendFormatString( messagePtr, _L("SecurityZone: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SecurityZone() );
|
|
663 |
/* TODO: to solve process details
|
|
664 |
CMemSpyEngineObjectContainer& container = iEngine.Container();
|
|
665 |
TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex().iId );
|
|
666 |
TRAP_IGNORE(
|
|
667 |
CMemSpyProcess& process = container.ProcessByIdL( id );
|
|
668 |
AppendFormatString( messagePtr, _L("\nSID: 0x%08X\n"), process.SID() );
|
|
669 |
AppendFormatString( messagePtr, _L("VID: 0x%08X\n"), process.VID() );
|
|
670 |
AppendFormatString( messagePtr, _L("UID1: 0x%08X\n"), process.UIDs()[0].iUid );
|
|
671 |
AppendFormatString( messagePtr, _L("UID2: 0x%08X\n"), process.UIDs()[1].iUid );
|
|
672 |
AppendFormatString( messagePtr, _L("UID3: 0x%08X\n"), process.UIDs()[2].iUid );
|
|
673 |
AppendFormatString( messagePtr, _L("Caps: 0x%08X%08X"), process.Capabilities().iCaps[0], process.Capabilities().iCaps[1]);
|
|
674 |
);
|
|
675 |
*/
|
|
676 |
break;
|
|
677 |
}
|
|
678 |
case EMemSpyDriverContainerTypeChunk:
|
|
679 |
{
|
|
680 |
AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
|
|
681 |
AppendFormatString( messagePtr, _L("Size: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Size() );
|
|
682 |
AppendFormatString( messagePtr, _L("MaxSize: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MaxSize() );
|
|
683 |
AppendFormatString( messagePtr, _L("Bottom: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Bottom() );
|
|
684 |
AppendFormatString( messagePtr, _L("Top: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Top() );
|
|
685 |
AppendFormatString( messagePtr, _L("Attr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
|
|
686 |
AppendFormatString( messagePtr, _L("Start: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->StartPos() );
|
|
687 |
AppendFormatString( messagePtr, _L("CntrlID: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ControllingOwner() );
|
|
688 |
AppendFormatString( messagePtr, _L("Restrictions: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Restrictions() );
|
|
689 |
AppendFormatString( messagePtr, _L("MapAttr: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapAttr() );
|
|
690 |
AppendFormatString( messagePtr, _L("Type: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ChunkType() );
|
|
691 |
TFullName procName;
|
|
692 |
procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
693 |
AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
|
|
694 |
procName.Zero();
|
|
695 |
// OwnerAddr iAddressOfKernelOwner already listed
|
|
696 |
// ProcAddr iAddressOfOwningProcess already listed
|
|
697 |
break;
|
|
698 |
}
|
|
699 |
case EMemSpyDriverContainerTypeLibrary:
|
|
700 |
{
|
|
701 |
AppendFormatString( messagePtr, _L("\nMapCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapCount() );
|
|
702 |
AppendFormatString( messagePtr, _L("State: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->State() );
|
|
703 |
AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
|
|
704 |
break;
|
|
705 |
}
|
|
706 |
case EMemSpyDriverContainerTypeSemaphore:
|
|
707 |
{
|
|
708 |
AppendFormatString( messagePtr, _L("\nCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
|
|
709 |
AppendFormatString( messagePtr, _L("Resetting: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
|
|
710 |
break;
|
|
711 |
}
|
|
712 |
case EMemSpyDriverContainerTypeMutex:
|
|
713 |
{
|
|
714 |
AppendFormatString( messagePtr, _L("\nHoldCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
|
|
715 |
AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
|
|
716 |
AppendFormatString( messagePtr, _L("Resetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
|
|
717 |
AppendFormatString( messagePtr, _L("Order: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Order() );
|
|
718 |
break;
|
|
719 |
}
|
|
720 |
case EMemSpyDriverContainerTypeTimer:
|
|
721 |
{
|
|
722 |
AppendFormatString( messagePtr, _L("\nState: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerState() );
|
|
723 |
AppendFormatString( messagePtr, _L("Type: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerType() );
|
|
724 |
break;
|
|
725 |
}
|
|
726 |
case EMemSpyDriverContainerTypeServer:
|
|
727 |
{
|
|
728 |
// Owner == ThrdAddr
|
|
729 |
AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
|
|
730 |
TFullName thrName;
|
|
731 |
thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
732 |
AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
|
|
733 |
thrName.Zero();
|
|
734 |
AppendFormatString( messagePtr, _L("Type: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
|
|
735 |
TBuf8<55>buf;
|
|
736 |
/*
|
|
737 |
RArray<TMemSpyDriverServerSessionInfo> sessions;
|
|
738 |
CleanupClosePushL( sessions );
|
|
739 |
iEngine.HelperServer().GetServerSessionsL( iKernelObjectItems[iListBox->CurrentItemIndex(), sessions );
|
|
740 |
const TInt count = sessions.Count();
|
|
741 |
for ( TInt i = 0; i < count; i++ )
|
|
742 |
{
|
|
743 |
const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
|
|
744 |
AppendFormatString( messagePtr, _L("SessAddr: 0x%08X\n"), session.iAddress );
|
|
745 |
TFullName sessName;
|
|
746 |
sessName.Copy( session.iName );
|
|
747 |
AppendFormatString( messagePtr, _L("Sess: %S\n"), &sessName );
|
|
748 |
}
|
|
749 |
CleanupStack::PopAndDestroy( &sessions );
|
|
750 |
*/
|
|
751 |
break;
|
|
752 |
}
|
|
753 |
case EMemSpyDriverContainerTypeSession:
|
|
754 |
{
|
|
755 |
// Server == SvrAddr
|
|
756 |
AppendFormatString( messagePtr, _L("\nServer: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfServer() );
|
|
757 |
TFullName srvName;
|
|
758 |
srvName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
|
|
759 |
AppendFormatString( messagePtr, _L("Srv: %S\n"), &srvName );
|
|
760 |
srvName.Zero();
|
|
761 |
// Session: not supported
|
|
762 |
AppendFormatString( messagePtr, _L("AccCount: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TotalAccessCount() );
|
|
763 |
AppendFormatString( messagePtr, _L("SesType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
|
|
764 |
AppendFormatString( messagePtr, _L("SvrType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SvrSessionType() );
|
|
765 |
AppendFormatString( messagePtr, _L("MsgCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgCount() );
|
|
766 |
AppendFormatString( messagePtr, _L("MsgLimit: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgLimit() );
|
|
767 |
break;
|
|
768 |
}
|
|
769 |
case EMemSpyDriverContainerTypeLogicalDevice:
|
|
770 |
{
|
|
771 |
AppendFormatString( messagePtr,
|
|
772 |
_L("\nVersion: %d.%d.%d\n"),
|
|
773 |
/*
|
|
774 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMajor, TODO: To solve this
|
|
775 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMinor,
|
|
776 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iBuild );
|
|
777 |
*/
|
|
778 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
|
|
779 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
|
|
780 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
|
|
781 |
AppendFormatString( messagePtr, _L("ParseMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ParseMask() );
|
|
782 |
AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
|
|
783 |
AppendFormatString( messagePtr, _L("Open channels: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->OpenChannels() );
|
|
784 |
break;
|
|
785 |
}
|
|
786 |
case EMemSpyDriverContainerTypePhysicalDevice:
|
|
787 |
{
|
|
788 |
AppendFormatString( messagePtr,
|
|
789 |
_L("\nVersion: %d.%d.%d\n"),
|
|
790 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
|
|
791 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
|
|
792 |
iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
|
|
793 |
AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
|
|
794 |
AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
|
|
795 |
break;
|
|
796 |
}
|
|
797 |
case EMemSpyDriverContainerTypeLogicalChannel:
|
|
798 |
{
|
|
799 |
// No other details
|
|
800 |
break;
|
|
801 |
}
|
|
802 |
case EMemSpyDriverContainerTypeChangeNotifier:
|
|
803 |
{
|
|
804 |
AppendFormatString( messagePtr, _L("\nChanges: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Changes() );
|
|
805 |
// Thread == ThrdAddr
|
|
806 |
AppendFormatString( messagePtr, _L("ThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
|
|
807 |
TFullName thrName;
|
|
808 |
thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
809 |
AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
|
|
810 |
thrName.Zero();
|
|
811 |
break;
|
|
812 |
}
|
|
813 |
case EMemSpyDriverContainerTypeUndertaker:
|
|
814 |
{
|
|
815 |
// Thread == ThrdAddr
|
|
816 |
AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
|
|
817 |
TFullName thrName;
|
|
818 |
thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
819 |
AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
|
|
820 |
thrName.Zero();
|
|
821 |
break;
|
|
822 |
}
|
|
823 |
case EMemSpyDriverContainerTypeMsgQueue:
|
|
824 |
{
|
|
825 |
// No other details
|
|
826 |
break;
|
|
827 |
}
|
|
828 |
case EMemSpyDriverContainerTypePropertyRef:
|
|
829 |
{
|
|
830 |
/*
|
|
831 |
Not listing details here, as propertyRef is not listed in TaskMgr.
|
|
832 |
Following propertyRef attributes are available at engine side.
|
|
833 |
|
|
834 |
IsReady
|
|
835 |
Type
|
|
836 |
Category
|
|
837 |
Key
|
|
838 |
RefCount
|
|
839 |
ThreadId
|
|
840 |
CreatorSID
|
|
841 |
*/
|
|
842 |
break;
|
|
843 |
}
|
|
844 |
case EMemSpyDriverContainerTypeCondVar:
|
|
845 |
{
|
|
846 |
AppendFormatString( messagePtr, _L("\nResetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
|
|
847 |
// Using iAddressOfOwningThread for mutex
|
|
848 |
AppendFormatString( messagePtr, _L("Mutex: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
|
|
849 |
// Using iNameOfOwner for mutex
|
|
850 |
TFullName mtxName;
|
|
851 |
mtxName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
|
|
852 |
AppendFormatString( messagePtr, _L("Mtx: %S\n"), &mtxName );
|
|
853 |
mtxName.Zero();
|
|
854 |
AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
|
|
855 |
/*
|
|
856 |
RArray<TMemSpyDriverCondVarSuspendedThreadInfo> threads;
|
|
857 |
CleanupClosePushL( threads );
|
|
858 |
iEngine.HelperCondVar().GetCondVarSuspendedThreadsL( iKernelObjectItems[iListBox->CurrentItemIndex(), threads );
|
|
859 |
const TInt count = threads.Count();
|
|
860 |
for ( TInt i = 0; i < count; i++ )
|
|
861 |
{
|
|
862 |
const TMemSpyDriverCondVarSuspendedThreadInfo& thr = threads[ i ];
|
|
863 |
AppendFormatString( messagePtr, _L("SuspThrdAddr: 0x%08X\n"), thr.iAddress );
|
|
864 |
TFullName thrName;
|
|
865 |
thrName.Copy( thr.iName );
|
|
866 |
AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
|
|
867 |
}
|
|
868 |
CleanupStack::PopAndDestroy( &threads );
|
|
869 |
*/
|
|
870 |
break;
|
|
871 |
}
|
|
872 |
default:
|
|
873 |
{
|
|
874 |
// Programming error
|
|
875 |
__ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
|
|
876 |
}
|
|
877 |
}
|
|
878 |
|
|
879 |
CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
|
|
880 |
dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
|
|
881 |
TFileName headerText;
|
|
882 |
headerText.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
|
|
883 |
dialog->SetHeaderTextL( headerText );
|
|
884 |
dialog->SetMessageTextL(messagePtr);
|
|
885 |
dialog->RunLD();
|
|
886 |
CleanupStack::PopAndDestroy( messageBuf );
|
|
887 |
}
|
|
888 |
|
|
889 |
|
|
890 |
void CMemSpyViewKernelObjects::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
|
|
891 |
{
|
|
892 |
TBuf<KMaxInfoLength> infoString;
|
|
893 |
VA_LIST list;
|
|
894 |
VA_START ( list, aFmt );
|
|
895 |
infoString.FormatList( aFmt, list );
|
|
896 |
aPtr.Append( infoString );
|
|
897 |
}
|
|
898 |
|