perfsrv/memspy/MemSpyClient/src/memspyapicodesegment.cpp
author hgs
Tue, 26 Oct 2010 16:20:32 +0300
changeset 62 1c2bb2fc7c87
permissions -rw-r--r--
201043
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <memspy/api/memspyapicodesegment.h>
hgs
parents:
diff changeset
    19
#include <memspy/engine/memspycodesegmentdata.h>
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
EXPORT_C CMemSpyApiCodeSegment::~CMemSpyApiCodeSegment()
hgs
parents:
diff changeset
    23
	{
hgs
parents:
diff changeset
    24
	delete iCodeSegmentData;
hgs
parents:
diff changeset
    25
	}
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
EXPORT_C const TDesC& CMemSpyApiCodeSegment::Name() const
hgs
parents:
diff changeset
    28
    {
hgs
parents:
diff changeset
    29
    return iCodeSegmentData->iName;
hgs
parents:
diff changeset
    30
    }
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32
EXPORT_C TInt CMemSpyApiCodeSegment::CodeSize() const
hgs
parents:
diff changeset
    33
	{
hgs
parents:
diff changeset
    34
	return iCodeSegmentData->iCodeSize;
hgs
parents:
diff changeset
    35
	}
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
EXPORT_C TInt CMemSpyApiCodeSegment::TotalDataSize() const
hgs
parents:
diff changeset
    38
	{
hgs
parents:
diff changeset
    39
	return iCodeSegmentData->iTotalDataSize;
hgs
parents:
diff changeset
    40
	}
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
EXPORT_C TInt CMemSpyApiCodeSegment::TextSize() const
hgs
parents:
diff changeset
    43
	{
hgs
parents:
diff changeset
    44
	return iCodeSegmentData->iTextSize;
hgs
parents:
diff changeset
    45
	}
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
EXPORT_C TInt CMemSpyApiCodeSegment::DataSize() const
hgs
parents:
diff changeset
    48
	{
hgs
parents:
diff changeset
    49
	return iCodeSegmentData->iDataSize;
hgs
parents:
diff changeset
    50
	}
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
EXPORT_C TInt CMemSpyApiCodeSegment::BssSize() const
hgs
parents:
diff changeset
    53
	{
hgs
parents:
diff changeset
    54
	return iCodeSegmentData->iBssSize;
hgs
parents:
diff changeset
    55
	}
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
EXPORT_C TUidType CMemSpyApiCodeSegment::Uids() const
hgs
parents:
diff changeset
    58
	{
hgs
parents:
diff changeset
    59
	return iCodeSegmentData->iUids;
hgs
parents:
diff changeset
    60
	}
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
EXPORT_C TUint32 CMemSpyApiCodeSegment::ModuleVersion() const
hgs
parents:
diff changeset
    63
	{
hgs
parents:
diff changeset
    64
	return iCodeSegmentData->iModuleVersion;
hgs
parents:
diff changeset
    65
	}
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
EXPORT_C TUint32 CMemSpyApiCodeSegment::SID() const
hgs
parents:
diff changeset
    68
	{
hgs
parents:
diff changeset
    69
	return iCodeSegmentData->iSecureId;
hgs
parents:
diff changeset
    70
	}
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
EXPORT_C TUint32 CMemSpyApiCodeSegment::VID() const
hgs
parents:
diff changeset
    73
	{
hgs
parents:
diff changeset
    74
	return iCodeSegmentData->iVendorId;
hgs
parents:
diff changeset
    75
	}
hgs
parents:
diff changeset
    76
hgs
parents:
diff changeset
    77
EXPORT_C TUint32 CMemSpyApiCodeSegment::EntryPtVeneer() const		// address of first instruction to be called
hgs
parents:
diff changeset
    78
	{
hgs
parents:
diff changeset
    79
	return iCodeSegmentData->iEntryPtVeneer;
hgs
parents:
diff changeset
    80
	}
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
EXPORT_C TUint32 CMemSpyApiCodeSegment::FileEntryPoint() const	// address of entry point within this code segment
hgs
parents:
diff changeset
    83
	{
hgs
parents:
diff changeset
    84
	return iCodeSegmentData->iFileEntryPoint;
hgs
parents:
diff changeset
    85
	}
hgs
parents:
diff changeset
    86
hgs
parents:
diff changeset
    87
EXPORT_C TInt CMemSpyApiCodeSegment::DepCount() const
hgs
parents:
diff changeset
    88
	{
hgs
parents:
diff changeset
    89
	return iCodeSegmentData->iDepCount;
hgs
parents:
diff changeset
    90
	}
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
EXPORT_C TUint32 CMemSpyApiCodeSegment::CodeLoadAddress() const	// 0 for RAM loaded code, else pointer to TRomImageHeader
hgs
parents:
diff changeset
    93
	{
hgs
parents:
diff changeset
    94
	return iCodeSegmentData->iCodeLoadAddress;
hgs
parents:
diff changeset
    95
	}
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
EXPORT_C TUint32 CMemSpyApiCodeSegment::DataLoadAddress() const
hgs
parents:
diff changeset
    98
	{
hgs
parents:
diff changeset
    99
	return iCodeSegmentData->iDataLoadAddress;
hgs
parents:
diff changeset
   100
	}
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
EXPORT_C TUint32 CMemSpyApiCodeSegment::Capabilities1() const
hgs
parents:
diff changeset
   103
	{
hgs
parents:
diff changeset
   104
	return iCodeSegmentData->iCapabilities1;
hgs
parents:
diff changeset
   105
	}
hgs
parents:
diff changeset
   106
hgs
parents:
diff changeset
   107
EXPORT_C TUint32 CMemSpyApiCodeSegment::Capabilities2() const
hgs
parents:
diff changeset
   108
	{
hgs
parents:
diff changeset
   109
	return iCodeSegmentData->iCapabilities2;
hgs
parents:
diff changeset
   110
	}
hgs
parents:
diff changeset
   111
hgs
parents:
diff changeset
   112
CMemSpyApiCodeSegment::CMemSpyApiCodeSegment() : iCodeSegmentData(0)
hgs
parents:
diff changeset
   113
	{
hgs
parents:
diff changeset
   114
	}
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
void CMemSpyApiCodeSegment::ConstructL(const TMemSpyCodeSegmentData& aData)
hgs
parents:
diff changeset
   117
	{
hgs
parents:
diff changeset
   118
	iCodeSegmentData = new (ELeave) TMemSpyCodeSegmentData(aData);
hgs
parents:
diff changeset
   119
	}
hgs
parents:
diff changeset
   120
hgs
parents:
diff changeset
   121
CMemSpyApiCodeSegment* CMemSpyApiCodeSegment::NewL(const TMemSpyCodeSegmentData& aData)
hgs
parents:
diff changeset
   122
	{
hgs
parents:
diff changeset
   123
	CMemSpyApiCodeSegment* self = CMemSpyApiCodeSegment::NewLC(aData);
hgs
parents:
diff changeset
   124
	CleanupStack::Pop(self);
hgs
parents:
diff changeset
   125
	return (self);
hgs
parents:
diff changeset
   126
	}
hgs
parents:
diff changeset
   127
hgs
parents:
diff changeset
   128
CMemSpyApiCodeSegment* CMemSpyApiCodeSegment::NewLC(const TMemSpyCodeSegmentData& aData)
hgs
parents:
diff changeset
   129
	{
hgs
parents:
diff changeset
   130
	CMemSpyApiCodeSegment* self = new (ELeave) CMemSpyApiCodeSegment;
hgs
parents:
diff changeset
   131
	CleanupStack::PushL(self);
hgs
parents:
diff changeset
   132
	self->ConstructL(aData);
hgs
parents:
diff changeset
   133
	return (self);
hgs
parents:
diff changeset
   134
	}