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 |
// Defines D_EXC formatter plugin class
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalTechnology
|
|
22 |
@released
|
|
23 |
*/
|
|
24 |
|
|
25 |
#ifndef D_EXC_FORMATTER_H
|
|
26 |
#define D_EXC_FORMATTER_H
|
|
27 |
|
|
28 |
#include <e32std.h>
|
|
29 |
#include <e32property.h>
|
|
30 |
#include <rm_debug_api.h> //registers info
|
|
31 |
|
|
32 |
#include <formatterapi.h>
|
|
33 |
#include <optionconfig.h>
|
|
34 |
#include <crashdatasource.h>
|
|
35 |
#include <crashdatasave.h>
|
|
36 |
#include "tdexcformatter.h" //test friendship
|
|
37 |
#include <coredumpserverapi.h> //property - UID
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
const TUint32 KDEXCFormatterUid = { 0x102832C5 };
|
|
42 |
|
|
43 |
const TInt KMaxLineLength = KMaxFullName + 32; //compatibility with legacy D_EXC implementation
|
|
44 |
_LIT(KPluginDescription, "D_EXC formatter plugin description");
|
|
45 |
|
|
46 |
class COptionConfig;
|
|
47 |
class CThreadInfo;
|
|
48 |
|
|
49 |
/**
|
|
50 |
@internalTechnology
|
|
51 |
@released
|
|
52 |
DEXC formatter plugin is loaded by the core dump server and notified about the crash event.
|
|
53 |
Then it dupms crash data in the same format as the legacy d_exc crash dump utility.
|
|
54 |
@see CCrashDataSave
|
|
55 |
*/
|
|
56 |
class CDexcFormatter : public CCoreDumpFormatter
|
|
57 |
{
|
|
58 |
static void CleanupThreadList(TAny *aArray);
|
|
59 |
static void CleanupCodeSegList(TAny *aArray);
|
|
60 |
friend void CDexcFormatterTest::TestSuiteL(TSuite aSuite) const; //test harness
|
|
61 |
enum { KBufSize = 1024 }; //mem read buf size
|
|
62 |
enum { KDexcFileNameLength = 26 }; //d_exc_<tid>.[stk|txt]
|
|
63 |
|
|
64 |
public:
|
|
65 |
static CDexcFormatter* NewL();
|
|
66 |
static CDexcFormatter* NewLC();
|
|
67 |
~CDexcFormatter();
|
|
68 |
|
|
69 |
public:
|
|
70 |
virtual TInt GetNumberConfigParametersL( );
|
|
71 |
virtual COptionConfig * GetConfigParameterL( const TInt aIndex );
|
|
72 |
virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue );
|
|
73 |
|
|
74 |
virtual void ConfigureDataSaveL(CCrashDataSave* aDataSave);
|
|
75 |
virtual void ConfigureDataSourceL(CCrashDataSource* aDataSource);
|
|
76 |
virtual void GetDescription(TDes& aPluginDescription);
|
|
77 |
virtual void CrashEventL(TCrashInfo* aCrashInfo);
|
|
78 |
|
|
79 |
private:
|
|
80 |
void ConstructL();
|
|
81 |
void DumpLogL(const CThreadInfo& aThread);
|
|
82 |
void DumpPanicInfoL(const TCrashInfo& aInfo);
|
|
83 |
void DumpExcInfoL(const TCrashInfo& aCrash);
|
|
84 |
void DumpRegistersL(const TUint64 aTid);
|
|
85 |
void DumpCodeSegsL(const TUint64 aPid) ;
|
|
86 |
void DumpStackL(const TUint64 aTid, const CThreadInfo& aInfo);
|
|
87 |
void UpdateCrashProgressL(const TDesC &aProgress) const;
|
|
88 |
TInt PickRegisters(const RRegisterList& aAllRegs, RRegisterList& aReqRegs,
|
|
89 |
const TFunctionalityRegister* const aReqIds) const;
|
|
90 |
const CThreadInfo& GetCrashedThreadInfoLC(const TCrashInfo &aCrashInfo) const;
|
|
91 |
|
|
92 |
const TDesC& DumpFileNameLC(TUint64 aTid, const TDesC &aExtension);
|
|
93 |
|
|
94 |
private:
|
|
95 |
/** Buffer holding each dump line */
|
|
96 |
TBuf8<KMaxLineLength> iLine;
|
|
97 |
|
|
98 |
/** reserved for the future */
|
|
99 |
TInt iSpare;
|
|
100 |
|
|
101 |
/** Pointer to writer plugin created and managed by core dump server, provides API to store the dump information*/
|
|
102 |
CCrashDataSave* iDataSave;
|
|
103 |
|
|
104 |
/** Pointer to data source object created and managed by core dump server, provides API to gather necessary info about the crash */
|
|
105 |
CCrashDataSource* iDataSource;
|
|
106 |
|
|
107 |
/** Dump stack information flag, updated on parameter change */
|
|
108 |
TBool iDumpStack;
|
|
109 |
|
|
110 |
/** Dump stack in ASCII format flag, updated on parameter change */
|
|
111 |
TBool iAsciiStack;
|
|
112 |
|
|
113 |
/** Available values of DEXC formatter plugin parameter index */
|
|
114 |
enum TDexcParams
|
|
115 |
{
|
|
116 |
/** dump stack */
|
|
117 |
EDumpStack,
|
|
118 |
/** dump stack in ASCII */
|
|
119 |
EAsciiStack,
|
|
120 |
/** guard */
|
|
121 |
EDexcParamsLast
|
|
122 |
};
|
|
123 |
|
|
124 |
/** DEXC formatter configuration parameter list */
|
|
125 |
RConfigParameterList iConfigList;
|
|
126 |
};
|
|
127 |
#endif
|