Developing a Formatter Plug-in

This section guides you through the process of developing a formatter plug-in.

A formatter plug-in is an ECOM plug-in that implements the Formatter API and is used to gather core dump information captured by the Core Dump Subsystem (CDS) in a particular format. For details on ECOM, refer to Symbian^2 » Symbian OS guide » Generic OS Services Guide » Low Level Libraries and Frameworks » Plug-in Framework.

By default, CDS provides the following formatter plug-ins:

  • The Symbian ELF formatter creates core dump in Symbian ELF format. For more information, refer to Symbian ELF Formatter plug-in.

  • The D_EXC formatter creates core dump information in D_EXC format.

  • The UTrace formatter generates a .utf file out of the trace information that is present in the core dump.

The following guidelines must be followed while developing a formatter plug-in:

  • There must be a link to the cdssupport.lib library.

  • The plug-in must implement the CCoreDumpFormatter interface, which provides the basic functionality required by a formatter plug-in.

  • The ECOM plug-in API ID must be 0x10282fe2. This ID is specified in the interface_uid field of the plug-in's .rss (resource) file.

  • Add the UID of the ECOM plug-in to one of the .plugin files located in the CDS private directory for each drive. The core dump server scans these .plugin files when it is started, and loads only those plug-ins whose UIDs are listed in the file.

Example

The following is an example ECOM formatter plug-in (header file) that implements the Formatter API:

// my_formatter.h

#ifndef __MY_FORMATTER_H__
#define __MY_FORMATTER_H__


#include "formatterapi.h"
#include "crashdatasource.h"
#include "crashdatasave.h"
#include "optionconfig.h"


class CMyFormatter : public CCoreDumpFormatter
{
public:
    static CMyFormatter* NewL();
    static CMyFormatter* NewLC();
    virtual ~CMyFormatter();

public:
//Implemented all the pure virtual functions defined by CCoreDumpFormatter interface

    void ConfigureDataSaveL( CCrashDataSave * aDataSave );

    void ConfigureDataSourceL( CCrashDataSource * aDataSource );
    
    void GetDescription( TDes & aPluginDescription );

    void CrashEventL( TCrashInfo* aCrashInfo );

    TInt GetNumberConfigParametersL( );

    COptionConfig * GetConfigParameterL( const TInt aIndex );

    TInt SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue );

};

#endif // __MY_FORMATTER_H__