memana/analyzetoolclient/dynamicmemoryhook/src/codeblock.cpp
author Matti Laitinen <matti.t.laitinen@nokia.com>
Thu, 11 Feb 2010 15:51:35 +0200
changeset 0 f0f2b8682603
permissions -rw-r--r--
Add initial version of AnalyzeTool client under EPL

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Definitions for the class TCodeblock.
*
*/


#include "codeblock.h"
#include "atlog.h"

// -----------------------------------------------------------------------------
// TCodeblock::TCodeblock
// C++ default constructor.
// -----------------------------------------------------------------------------
//
TCodeblock::TCodeblock( TLinAddr aRunAddress, 
                        TUint32 aSize, 
                        TBuf8<KMaxLibraryName>& aName ) :
                        iStartAddress( aRunAddress ),
                        iEndAddress( aRunAddress + aSize )
    {
    LOGSTR3( "ATMH TCodeblock::TCodeblock() %x - %x", iStartAddress, iEndAddress );
    iName.Copy( aName );
    }

// -----------------------------------------------------------------------------
// TCodeblock::CheckAddress
// Checks if the given address is in this memory block area
// -----------------------------------------------------------------------------
//
TBool TCodeblock::CheckAddress( TUint32 aAddress )
    {
    if ( iStartAddress <= aAddress && aAddress <= iEndAddress )
        {
        return ETrue;
        }
    return EFalse;
    }

// -----------------------------------------------------------------------------
// TCodeblock::Match
// Matches if the given parameters represents this memory block 
// -----------------------------------------------------------------------------
//
TBool TCodeblock::Match( TBuf8<KMaxLibraryName>& aName )
    {
    LOGSTR1( "ATMH TCodeblock::Match()" );
    return ( 0 == iName.CompareF( aName ) ) ? ETrue : EFalse;
    }

// -----------------------------------------------------------------------------
// TCodeblock::EndAddress
// Returns specific segment's end address
// -----------------------------------------------------------------------------
//
TUint32 TCodeblock::EndAddress()
    {
    return iEndAddress;
    }

// -----------------------------------------------------------------------------
// TCodeblock::StartAddress
// Returns specific segment's start address
// -----------------------------------------------------------------------------
//
TUint32 TCodeblock::StartAddress()
    {
    return iStartAddress;
    }

// -----------------------------------------------------------------------------
// TCodeblock::Name
// Gets specific segment's name
// -----------------------------------------------------------------------------
//
void TCodeblock::Name( TDes8& aName )
    {
    aName.Copy( iName );
    }

// End of File