[8] | 1 | /*
|
---|
| 2 | * TOPPERS Software
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems
|
---|
| 4 | *
|
---|
| 5 | * Copyright (C) 2005-2008 by TAKAGI Nobuhisa
|
---|
| 6 | *
|
---|
| 7 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
| 8 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
| 9 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
| 10 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
| 11 | * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
| 12 | * XR[hÉÜÜêÄ¢é±ÆD
|
---|
| 13 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
| 14 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
| 15 | gip
|
---|
| 16 | * Ò}j
|
---|
| 17 | AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL
|
---|
| 18 | * ̳ÛØKèðfÚ·é±ÆD
|
---|
| 19 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
| 20 | * pÅ«È¢`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
| 21 | * ÆD
|
---|
| 22 | * (a) Äzzɺ¤hL
|
---|
| 23 | gipÒ}j
|
---|
| 24 | AÈÇjÉCãLÌ
|
---|
| 25 | * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD
|
---|
| 26 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
| 27 | * ñ·é±ÆD
|
---|
| 28 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
| 29 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
| 30 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
| 31 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
| 32 | * ÆÓ·é±ÆD
|
---|
| 33 | *
|
---|
| 34 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
| 35 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
| 36 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
| 37 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
| 38 | * ÌÓCðíÈ¢D
|
---|
| 39 | *
|
---|
| 40 | */
|
---|
| 41 |
|
---|
| 42 | /*!
|
---|
| 43 | * \file toppers/debug.hpp
|
---|
| 44 | * \brief fobOpCuÉÖ·éé¾è`
|
---|
| 45 | */
|
---|
| 46 | #ifndef TOPPERS_DEBUG_HPP_
|
---|
| 47 | #define TOPPERS_DEBUG_HPP_
|
---|
| 48 |
|
---|
| 49 | #include "toppers/config.hpp"
|
---|
| 50 | #include <iostream>
|
---|
| 51 | #if defined( _WIN32 ) || defined( __WIN32__ ) || defined( WIN32 )
|
---|
| 52 | #include <windows.h>
|
---|
| 53 | #include <sstream>
|
---|
| 54 | #endif
|
---|
| 55 |
|
---|
| 56 | namespace toppers
|
---|
| 57 | {
|
---|
| 58 |
|
---|
| 59 | template < typename T >
|
---|
| 60 | void trace( char const* str, const T& value )
|
---|
| 61 | {
|
---|
| 62 | #if defined( _WIN32 ) || defined( __WIN32__ ) || defined( WIN32 )
|
---|
| 63 | std::ostringstream ostr;
|
---|
| 64 | ostr << str << value << '\n';
|
---|
| 65 | ::OutputDebugString( ostr.str().c_str() );
|
---|
| 66 | #else
|
---|
| 67 | std::cerr << str << value << std::endl;
|
---|
| 68 | #endif
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | #if defined( _DEBUG ) || defined( __DEBUG ) || defined( DEBUG )
|
---|
| 74 | #define TOPPERS_TRACE( str, value ) ::toppers::trace( ( str ), ( value ) )
|
---|
| 75 | #else
|
---|
| 76 | #define TOPPERS_TRACE( str, value ) ( ( void )0 )
|
---|
| 77 | #endif
|
---|
| 78 |
|
---|
| 79 | #endif // ! TOPPERS_DEBUG_HPP_
|
---|