engine/inc/debug.h
author Sebastian Brannstrom <sebastianb@symbian.org>
Thu, 21 Oct 2010 15:51:40 +0100
branchsymbian1
changeset 261 55305e953f12
parent 2 29cda98b007e
permissions -rw-r--r--
Bug 3367 - new icons!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
* All rights reserved.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
* This component and the accompanying materials are made available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
* under the terms of the License "Eclipse Public License v1.0"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
* which accompanies this distribution, and is available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
* Initial Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
* EmbedDev AB - initial contribution.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
* Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
* Description:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
// dbg_dp.h
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
// debug printouts
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
/*************************************************
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
    USAGE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
    DP("Hi there");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
    DP1("My name is %S", &name);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
    DPV1("My detailed info is %S", &detailedInfo);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
    DP_MSG(aMsg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
    DP_MSG_COMPL(aMsg, r);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
    DP_EXC(aType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
    CUSTOMISATION
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
    With SUPPORT_DP_CLIENT_SERVER_V2 defined, a
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
    proper opcode type (default TOpcode) needs to
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
    be specified.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
    NOTE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
    This file may be included by many components
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
    within one application and defining something
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
    here will affect all such components. In such
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
    cases it might be better to state a MACRO in
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
    the intended component's MMP file.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
**************************************************/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
#ifndef ___DBG_DP_H
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
#define ___DBG_DP_H
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
// This file may be included butThese defines may be individual
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
//#if defined (_DEBUG) && (__WINS__)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
//#if defined _DEBUG
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
#   define SUPPORT_DP_STANDARD
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
#   define SUPPORT_DP_FILE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
//#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
// #define SUPPORT_RDEBUG_PRINT
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
// #define SUPPORT_DP_VERBOSE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
// #define SUPPORT_DP_THREAD_NAME
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
// #define SUPPORT_DP_CLIENT_SERVER_V2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
// #define SUPPORT_DP_EXCEPTION
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
// #define SUPPORT_DP_COMMDB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
// ------------------------------------------------- no need to modify
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
#if defined (SUPPORT_RDEBUG_PRINT)\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
 || defined (SUPPORT_DP_VERBOSE)\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
 || defined(SUPPORT_DP_CLIENT_SERVER_V2)\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
 || defined(SUPPORT_DP_EXCEPTION)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
#   define SUPPORT_DP_STANDARD
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
#if defined(SUPPORT_RDEBUG_PRINT)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
#   include <e32svr.h> // RDebug
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
#if defined(SUPPORT_DP_FILE)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
#   include <flogger.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
#if defined(SUPPORT_DP_CLIENT_SERVER_V2)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    82
#   include "dbg_cmn.h" // TOpcode
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
#if defined(SUPPORT_DP_COMMDB)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
#   include <commdbconnpref.h> // TCommDbConnPref
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    87
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
namespace Dbg
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
// ------------------------------------------------- file output
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    93
#ifdef SUPPORT_DP_FILE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    94
_LIT(KLogDir, "podcatcher");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
_LIT(KLogFile, "debug.log");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    96
#   define DPF(a); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S %s"), &s, L##a);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
#   define DPF1(a,b); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
#   define DPF2(a,b,c); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b,c);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
#   define DPF3(a,b,c,d); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b,c,d);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
#   define DPF4(a,b,c,d,e); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b,c,d,e);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
#   define DPF5(a,b,c,d,e,f); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b,c,d,e,f);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
#   define DPF6(a,b,c,d,e,f,g); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("%S " L##a), &s, b, c, d,e,f,g);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
#	define HEXDUMP(aHeader, aMargin, aPtr, aLen); RFileLogger::HexDump(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, aHeader, aMargin, aPtr, aLen);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
#   define DPDT(dt); RFileLogger::WriteFormat(Dbg::KLogDir, Dbg::KLogFile, EFileLoggingModeAppend, _L("DateTime: %d-%d-%d %d:%d:%d "), dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second() );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
#   define DPF(a);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
#   define DPF1(a,b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
#   define DPF2(a,b,c);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
#   define DPF3(a,b,c,d);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
#   define DPF4(a,b,c,d,e);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
#   define DPF5(a,b,c,d,e,f);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
#   define DPF6(a,b,c,d,e,f,g);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
#	define HEXDUMP(aHeader, aMargin, aPtr, aLen);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
#   define DPDT(dt); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
// ------------------------------------------------- standard debugprint
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
#ifdef SUPPORT_DP_STANDARD
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
inline void FormatThreadName(TFullName& aName)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
    const TChar KLeftBracket('[');
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
    const TChar KScope(':');
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
    TInt a = aName.LocateReverse(KLeftBracket);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
    if (a==KErrNotFound)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
        { return; }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
    TInt b = aName.Locate(KScope);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
    if (b==KErrNotFound || b<a)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
        { return; }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
    aName.Delete(a,b-a);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
#ifdef SUPPORT_RDEBUG_PRINT
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
#   define DP(a);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   137
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
        RDebug::Print(_L("%S %s"), &s, L##a);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
        DPF(a);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
#   define DP1(a,b);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
        RDebug::Print(_L("%S " L##a), &s, b);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
        DPF1(a,b);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
#   define DP2(a,b,c);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   150
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   151
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
        RDebug::Print(_L("%S " L##a), &s, b,c);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
        DPF2(a,b,c);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
#   define DP3(a,b,c,d);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   156
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
        RDebug::Print(_L("%S " L##a), &s, b,c,d);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
        DPF3(a,b,c,d);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
#   define DP4(a,b,c,d,e);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   165
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   166
        RDebug::Print(_L("%S " L##a), &s, b,c,d,e);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   167
        DPF4(a,b,c,d,e);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
#   define DP5(a,b,c,d,e,f);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
        RDebug::Print(_L("%S " L##a), &s, b,c,d,e,f);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
        DPF5(a,b,c,d,e,f);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   176
#   define DP6(a,b,c,d,e,f,g);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   177
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
        RDebug::Print(_L("%S " L##a), &s, b,c,d,e,f,g);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
        DPF6(a,b,c,d,e,f,g);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
#else	//SUPPORT_RDEBUG_PRINT
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
#   define DP(a);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
        DPF(a);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
#   define DP1(a,b);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
        DPF1(a,b);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
#   define DP2(a,b,c);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
        DPF2(a,b,c);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
#   define DP3(a,b,c,d);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   205
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   206
        DPF3(a,b,c,d);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   208
#   define DP4(a,b,c,d,e);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
        DPF4(a,b,c,d,e);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
#   define DP5(a,b,c,d,e,f);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
        DPF5(a,b,c,d,e,f);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
#   define DP6(a,b,c,d,e,f,g);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
    {\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
        TFullName s = RThread().FullName();\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
        Dbg::FormatThreadName(s);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
        DPF6(a,b,c,d,e,f,g);\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
#endif	//SUPPORT_RDEBUG_PRINT
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
#   define ASSERT_DP(a, b); {if(!(a)){DP(b);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
#   define ASSERT_DP1(a,b,c); {if(!(a)){DP1(b,c);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
#   define ASSERT_DP2(a,b,c,d); {if(!(a)){DP2(b,c,d);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
#   define ASSERT_DP3(a,b,c,d,e); {if(!(a)){DP3(b,c,d,e);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
#   define ASSERT_DP4(a,b,c,d,e,f); {if(!(a)){DP4(b,c,d,e,f);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
#   define ASSERT_DP5(a,b,c,d,e,f,g); {if(!(a)){DP5(b,c,d,e,f,g);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
#   define ASSERT_DP6(a,b,c,d,e,f,g,h); {if(!(a)){DP6(b,c,d,e,f,g,h);}}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
// @brief stuff to get enum strings from enums
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
#   define ENUM_CASE(n,c)\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
        case c: { _LIT(KTxt##c, #c); n.Set(KTxt##c); break; }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
#   define DEFAULT(n)\
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
        default: { _LIT(KTxtUnknown, "Unknown"); n.Set(KTxtUnknown); break; }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
#   define DP(a);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
#   define DP1(a,b);;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
#   define DP2(a,b,c);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
#   define DP3(a,b,c,d);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
#   define DP4(a,b,c,d,e);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
#   define DP5(a,b,c,d,e,f);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
#   define DP6(a,b,c,d,e,f,g);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
#   define ASSERT_DP(a, b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
#   define ASSERT_DP1(a,b,c);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   249
#   define ASSERT_DP2(a,b,c,d);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
#   define ASSERT_DP3(a,b,c,d,e);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   251
#   define ASSERT_DP4(a,b,c,d,e,f);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
#   define ASSERT_DP5(a,b,c,d,e,f,g);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
#   define ASSERT_DP6(a,b,c,d,e,f,g,h);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
#   define ENUM_CASE(n,c)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   255
#   define DEFAULT(n)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   256
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   257
// ------------------------------------------------- detailed debugprint
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   258
#ifdef SUPPORT_DP_VERBOSE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
#   define DPV(a); { DP(a); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
#   define DPV1(a,b); { DP1(a,b); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
#   define DPV2(a,b,c); { DP2(a,b,c); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   262
#   define DPV3(a,b,c,d); { DP3(a,b,c,d); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
#   define DPV4(a,b,c,d,e); { DP4(a,b,c,d,e); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
#   define DPV5(a,b,c,d,e,f); { DP5(a,b,c,d,e,f); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
#   define DPV6(a,b,c,d,e,f,g); { DP6(a,b,c,d,e,f,g); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   266
#	define DPDTV(dt); { DPDT(dt); }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   267
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   268
#   define DPV(a);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   269
#   define DPV1(a,b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   270
#   define DPV2(a,b,c);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   271
#   define DPV3(a,b,c,d);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   272
#   define DPV4(a,b,c,d,e);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   273
#   define DPV5(a,b,c,d,e,f);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   274
#   define DPV6(a,b,c,d,e,f,g);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
#	define DPDTV(dt);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   277
// ------------------------------------------------- client/server V2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   278
#ifdef SUPPORT_DP_CLIENT_SERVER_V2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   279
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   280
// @brief Get client thread name from a message
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   281
static void GetClientName(const RMessage2& aMsg, TFullName& aName)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   282
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
    RThread thread;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   284
    aMsg.Client(thread);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   285
    aName = thread.FullName();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   286
    Dbg::FormatThreadName(aName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   287
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   288
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   289
// @brief Get server opcode from any message
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
static TOpcode GetServerOpcode(const RMessage2& aMsg)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   291
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
    return (TOpcode)aMsg.Function();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   294
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   295
// @brief Get server opcode name from a server opcode
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   296
static TPtrC GetServerOpcodeName(TOpcode aOpcode)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   297
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   298
    TPtrC name;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   299
    switch(aOpcode)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   300
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   301
        // ENUM_CASE(name, EOpcodeOne);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   302
        // ENUM_CASE(name, EOpcodeTwo);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   303
        DEFAULT(name);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   304
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   305
    return name;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   306
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   307
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   308
// @brief Print generic message.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   309
inline void PrintMsg(const RMessage2& aMsg)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   310
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   311
    TFullName threadName;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   312
    GetClientName(aMsg, threadName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   313
    TOpcode sOpcode = GetServerOpcode(aMsg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   314
    TPtrC sOpcodeName = GetServerOpcodeName(sOpcode);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
    DP3("? %S %S(%d)", &threadName, &sOpcodeName, sOpcode);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   316
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
// @brief Print generic message completion.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   319
inline void PrintMsgCompl(const RMessage2& aMsg, TInt aErr)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
    TFullName threadName;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
    GetClientName(aMsg, threadName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
    TOpcode sOpcode = GetServerOpcode(aMsg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   324
    TPtrC sOpcodeName = GetServerOpcodeName(sOpcode);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   325
    DP4("! %S %S(%d) r=%d", &threadName, &sOpcodeName, sOpcode, aErr);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   326
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   327
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   328
// m= message, r=error
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   329
#   define DP_MSG(m); PrintMsg(m);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   330
#   define DP_MSG_COMPL(m,r); PrintMsgCompl(m,r);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   331
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   332
#   define DP_MSG(m);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
#   define DP_MSG_COMPL(m,r);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
// ------------------------------------------------- exception debugprint
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   336
#ifdef SUPPORT_DP_EXCEPTION
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   337
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   338
// @brief Get an exception type
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   339
static TPtrC GetExcName(TExcType aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
    TPtrC name;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   342
    switch(aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   343
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   344
        ENUM_CASE(name, EExcGeneral);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   345
        ENUM_CASE(name, EExcIntegerDivideByZero);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   346
        ENUM_CASE(name, EExcSingleStep);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   347
        ENUM_CASE(name, EExcBreakPoint);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   348
        ENUM_CASE(name, EExcIntegerOverflow);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   349
        ENUM_CASE(name, EExcBoundsCheck);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   350
        ENUM_CASE(name, EExcInvalidOpCode);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   351
        ENUM_CASE(name, EExcDoubleFault);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   352
        ENUM_CASE(name, EExcStackFault);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   353
        ENUM_CASE(name, EExcAccessViolation);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   354
        ENUM_CASE(name, EExcPrivInstruction);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   355
        ENUM_CASE(name, EExcAlignment);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
        ENUM_CASE(name, EExcPageFault);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   357
        ENUM_CASE(name, EExcFloatDenormal);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
        ENUM_CASE(name, EExcFloatDivideByZero);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   359
        ENUM_CASE(name, EExcFloatInexactResult);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   360
        ENUM_CASE(name, EExcFloatInvalidOperation);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   361
        ENUM_CASE(name, EExcFloatOverflow);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   362
        ENUM_CASE(name, EExcFloatStackCheck);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   363
        ENUM_CASE(name, EExcFloatUnderflow);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   364
        ENUM_CASE(name, EExcAbort);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   365
        ENUM_CASE(name, EExcKill);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   366
        ENUM_CASE(name, EExcUserInterrupt);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   367
        ENUM_CASE(name, EExcDataAbort);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   368
        ENUM_CASE(name, EExcCodeAbort);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   369
        ENUM_CASE(name, EExcMaxNumber);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   370
        ENUM_CASE(name, EExcInvalidVector);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   371
        DEFAULT(name);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   372
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   373
    return name;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   374
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   375
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   376
// @brief Print exception info.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   377
inline void PrintExc(TExcType aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   378
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   379
    TPtrC excName = GetExcName(aType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
    DP2("### Exception %S(%d) ###", &excName, aType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   381
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   382
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   383
#   define DP_EXC(t); PrintExc(t);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   384
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   385
#   define DP_EXC(t);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   386
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   387
// ------------------------------------------------- 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   388
#ifdef SUPPORT_DP_COMMDB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   389
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
inline void LogIap(const TDesC* aName, const TCommDbConnPref& aPref)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   391
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   392
    TUint32 iapId=aPref.IapId();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   393
    TUint32 netId=aPref.NetId();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
    TCommDbDialogPref dlgPref=aPref.DialogPreference();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
    TCommDbConnectionDirection dir=aPref.Direction();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   396
    TUint32 bearerSet=aPref.BearerSet();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
    if(aName==0)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   398
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   399
        UI_FLOG(Log::Printf(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   400
            _L("iapId=%u, netId=%u, dlgPref=%d, dir=%d, bearerSet=0x%02x"),
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   401
            iapId, netId, dlgPref, dir, bearerSet));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   402
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   403
    else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   404
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   405
        UI_FLOG(Log::Printf(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   406
            _L("\"%S\", iapId=%u, netId=%u, dlgPref=%d, dir=%d, bearerSet=0x%02x"),
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   407
            aName, iapId, netId, dlgPref, dir, bearerSet));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   410
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
#   define DP_COMMDBCONNPREF(a,b); LogIap(a,b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   412
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   413
#   define DP_COMMDBCONNPREF(a,b);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   414
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   415
// ------------------------------------------------- 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   416
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   417
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   418
#endif //___DBG_DP_H
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   419