1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: dbg_Logger.h 4 5 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 34107 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* Please see man pages for details 17 18 19 20 */ 21 22 #ifndef NN_DBG_DBG_DUMP_H_ 23 #define NN_DBG_DBG_DUMP_H_ 24 25 #include <nn/types.h> 26 #include <nn/dbg/dbg_DebugString.h> 27 #include <nn/config.h> 28 29 #define NN_DBG_DUMP_FLAG_POINTER 1 30 #define NN_DBG_DUMP_FLAG_STRING 2 31 32 /* Please see man pages for details 33 34 35 36 37 38 39 */ 40 #ifndef NN_SWITCH_DISABLE_DEBUG_PRINT 41 #ifdef __cplusplus 42 #define NN_DUMP_MEMORY( p, size, flags ) nn::dbg::detail::DumpMemory(p, size, flags) 43 #else // ifdef __cplusplus 44 #define NN_DUMP_MEMORY( p, size, flags ) nndbgDetailDumpMemory(p, size, flags) 45 #endif // ifdef __cplusplus else 46 #else // ifndef NN_SWITCH_DISABLE_DEBUG_PRINT 47 #define NN_DUMP_MEMORY( p, size, flags ) ((void)0) 48 #endif // ifndef NN_SWITCH_DISABLE_DEBUG_PRINT else 49 50 #define NN_DUMP( p, size ) NN_DUMP_MEMORY(p, size, 0) 51 #define NN_DUMP_POINTER( p, size ) NN_DUMP_MEMORY(p, size, NN_DBG_DUMP_FLAG_POINTER) 52 #define NN_DUMP_STRING( p, size ) NN_DUMP_MEMORY(p, size, NN_DBG_DUMP_FLAG_POINTER|NN_DBG_DUMP_FLAG_STRING) 53 54 #ifdef __cplusplus 55 56 namespace nn { 57 namespace dbg { 58 namespace detail { 59 60 void DumpMemory(const void* p, size_t size, bit32 flags); 61 } 62 } 63 } 64 65 66 #endif // __cplusplus 67 68 //------------------------------------------------------------------- 69 // for C / C++ 70 71 #include <nn/util/detail/util_CLibImpl.h> 72 73 NN_EXTERN_C void nndbgDetailDumpMemory(const void* p, size_t size, bit32 flags); 74 75 #endif 76