Update contrib.
1 // Copyright (c) 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Responsible for dealing with static info in the Stop Mode framework
23 #ifdef __LAUNCH_AS_EXTENSION__
25 #include <rm_debug_api.h>
26 #include <sm_debug_api.h>
28 #include "d_rmd_breakpoints.h"
30 using namespace Debug;
32 const TInt KBUFSIZE = 128;
35 * Stop Mode routine to retrieve the static info and place it in the response buffer
36 * @param aItem List item describing the list
37 * @return One of the system wide error codes
39 TInt StopModeDebug::GetStaticInfo(const TListItem* aItem, bool aCheckConsistent)
41 __KTRACE_OPT(KDEBUGGER,Kern::Printf("\nDumping the static information"));
43 if(aItem->iListScope != EScopeGlobal)
45 return KErrArgument; //No other scope makes sense for static info
48 TUint8* buffer = (TUint8*)aItem->iBufferAddress;
49 TUint8* bufferPos = Align4(buffer + sizeof(TListReturn));
50 TUint8* bufferEnd = buffer + aItem->iBufferSize;
52 TListReturn* listResp = (TListReturn*)buffer;
53 listResp->iReqNo = EStaticInfo;
54 listResp->iNumberItems = 1; //there in only one structure of TStaticListEntry
55 listResp->iDataSize = sizeof(TStaticListEntry);
57 if (bufferPos < bufferEnd)
59 // making sure we have enough space to write the static info
60 TStaticListEntry& entry = *(TStaticListEntry*)(bufferPos);
62 // build version and rom build time
63 TRomHeader rHdr = Epoc::RomHeader();
64 entry.iTime = rHdr.iTime;
65 entry.iBuildNumber = rHdr.iVersion.iBuild;
66 entry.iMajorVersion = rHdr.iVersion.iMajor;
67 entry.iMinorVersion = rHdr.iVersion.iMinor;
70 entry.iCpuNumbers = NKern::NumberOfCpus();
72 TBuf<KBUFSIZE> bufTime64;
73 bufTime64.Num(rHdr.iTime);
75 __KTRACE_OPT(KDEBUGGER,Kern::Printf("Version%d.%02d(%03d) %d", rHdr.iVersion.iMajor, rHdr.iVersion.iMinor, rHdr.iVersion.iBuild));
76 __KTRACE_OPT(KDEBUGGER,Kern::Printf("Build Time %S ms", &bufTime64));
77 __KTRACE_OPT(KDEBUGGER,Kern::Printf("Number of CPUs in the system: %d", entry.iCpuNumbers));