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 UTRACE formatter plugin class
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalTechnology
|
|
22 |
@released
|
|
23 |
*/
|
|
24 |
|
|
25 |
#ifndef UTRACE_FORMATTER_H
|
|
26 |
#define UTRACE_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 <coredumpserverapi.h> //property - UID
|
|
37 |
|
|
38 |
const TUint32 KUtraceFormatterUID = { 0x102836BA };
|
|
39 |
|
|
40 |
_LIT(KPluginDescription, "UTrace formatter plugin");
|
|
41 |
_LIT(KUTraceCrashStart, "started utrace formatting");
|
|
42 |
_LIT(KUTraceCrashFinish, "done");
|
|
43 |
|
|
44 |
/**
|
|
45 |
@internalTechnology
|
|
46 |
@released
|
|
47 |
DEXC formatter plugin is loaded by the core dump server and notified about the crash event.
|
|
48 |
Then it dupms crash data in the same format as the legacy d_exc crash dump utility.
|
|
49 |
@see CCrashDataSave
|
|
50 |
*/
|
|
51 |
class CUtraceFormatter : public CCoreDumpFormatter
|
|
52 |
{
|
|
53 |
enum { KUTraceDumpFileLength = 23 };
|
|
54 |
|
|
55 |
public:
|
|
56 |
static CUtraceFormatter* NewL();
|
|
57 |
static CUtraceFormatter* NewLC();
|
|
58 |
~CUtraceFormatter();
|
|
59 |
|
|
60 |
public:
|
|
61 |
virtual TInt GetNumberConfigParametersL( );
|
|
62 |
virtual COptionConfig * GetConfigParameterL( const TInt aIndex );
|
|
63 |
virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue );
|
|
64 |
|
|
65 |
virtual void ConfigureDataSaveL(CCrashDataSave* aDataSave);
|
|
66 |
virtual void ConfigureDataSourceL(CCrashDataSource* aDataSource);
|
|
67 |
virtual void GetDescription(TDes& aPluginDescription);
|
|
68 |
virtual void CrashEventL(TCrashInfo* aCrashInfo);
|
|
69 |
|
|
70 |
private:
|
|
71 |
void ConstructL();
|
|
72 |
TUint HelpWriteTraceBufferL(TUint aTraceAvailable, TUint aTraceWanted, TUint aOffset);
|
|
73 |
TUint HelpWriteTraceBufferWithTraceFrameWorkL(TUint aTraceWanted, TUint aOffset);
|
|
74 |
|
|
75 |
private:
|
|
76 |
|
|
77 |
/** Pointer to writer plugin created and managed by core dump server, provides API to store the dump information*/
|
|
78 |
CCrashDataSave* iDataSave;
|
|
79 |
|
|
80 |
/** Pointer to data source object created and managed by core dump server, provides API to gather necessary info about the crash */
|
|
81 |
CCrashDataSource* iDataSource;
|
|
82 |
|
|
83 |
/** Values for utrace configuration */
|
|
84 |
enum TUTraceParams
|
|
85 |
{
|
|
86 |
/** Amount of trace to dump */
|
|
87 |
ETraceSize,
|
|
88 |
|
|
89 |
/** Gaurd */
|
|
90 |
ETraceGuard
|
|
91 |
};
|
|
92 |
|
|
93 |
const TDesC& DumpFileNameLC(TUint64 aStamp);
|
|
94 |
|
|
95 |
void UpdateCrashProgressL( const TDesC &aProgress );
|
|
96 |
|
|
97 |
public:
|
|
98 |
|
|
99 |
/** UTRACE formatter configuration parameter list */
|
|
100 |
RConfigParameterList iConfigList;
|
|
101 |
|
|
102 |
|
|
103 |
};
|
|
104 |
#endif
|