kernel/eka/drivers/hcr/hcr_debug.cpp
changeset 47 46fffbe7b5a7
parent 43 96e5fb8b040d
equal deleted inserted replaced
46:0bf4040442f9 47:46fffbe7b5a7
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // Helper functions for debug
    14 // Helper functions for HCR debug
    15 
    15 
    16 #include <e32err.h>
    16 #include <e32err.h>
    17 #include <e32const.h>
    17 #include <e32const.h>
    18 #include <e32def.h>
    18 #include <e32def.h>
    19 #include <e32cmn.h>
    19 #include <e32cmn.h>
    21 #include <kernel/kernel.h>
    21 #include <kernel/kernel.h>
    22 
    22 
    23 
    23 
    24 #include "hcr_debug.h"
    24 #include "hcr_debug.h"
    25 
    25 
       
    26 #ifdef HCR_TRACE
    26 /**
    27 /**
    27 Make a classic hexadecimal dump of the content of an memory region.
    28 Make a classic hexadecimal dump of the content of an memory region. Do not
       
    29 call directly but used the macros: HCR_HEX_DUMP_ABS(), HCR_HEX_DUMP_REL()
    28 
    30 
    29 @param 	aStartAddress	Pointer of the first byte of the region
    31 @param 	aStartAddress	Pointer of the first byte of the region
    30 				aLength				Size of the region
    32 		aLength			Size of the region
    31 				aAbsolute			If it is TRUE then it displays absolute address where the aStartAddress points
    33 		aAbsolute		If it is TRUE then it displays absolute address where the aStartAddress points
    32 											If it is FALSE then it displays reltive address from aStartAddress
    34 						If it is FALSE then it displays reltive address from aStartAddress
    33 
    35 
    34 @pre    Call from thread context (neither NULL, DFC0, DFC1 threads)
    36 @pre    Call from thread context (neither NULL, DFC0, DFC1 threads)
    35 */    
    37 */    
       
    38 
    36 void HexDump(TUint8* aStartAddress, TUint32 aLength, TBool aAbsolute)
    39 void HexDump(TUint8* aStartAddress, TUint32 aLength, TBool aAbsolute)
    37 	{
    40 	{
    38 	TUint32 nIndex;
    41 	TUint32 nIndex;
    39 	TBuf<128> printBuf;	// Buffer for address and values
    42 	TBuf<128> printBuf;	// Buffer for address and values
    40 	TBuf<32> printBuf2; // Buffer for character representation
    43 	TBuf<32> printBuf2; // Buffer for character representation
    94 	printBuf.Append(_L("    "));
    97 	printBuf.Append(_L("    "));
    95 	printBuf.Append(printBuf2);
    98 	printBuf.Append(printBuf2);
    96 	Kern::Printf("%S\n", &printBuf);		
    99 	Kern::Printf("%S\n", &printBuf);		
    97 	}
   100 	}
    98 	
   101 	
       
   102 #endif // HCR_TRACE