/
hyDebug.cpp
68 lines (51 loc) · 1.14 KB
/
hyDebug.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* -*- coding: sjis-dos; -*- */
/*
* copyright 2010 FUKUZAWA Tadashi. All rights reserved.
*/
#include "hyDebug.h"
#ifndef HY_TOOLS_BUILD
#include "hyThreadManager.h"
#else
#include "hyMemPool.h"
#endif
using namespace Hayat::Engine;
using namespace Hayat::Common;
MemPool* Debug::m_debugMemPool = NULL;
#ifdef HMD_DEBUG
#ifdef HMD__STACK_PRINT
bool Debug::m_bPrintStack = true;
#else
bool Debug::m_bPrintStack = false;
#endif
#ifdef HMD__OPCODE_PRINT
bool Debug::m_bPrintOpcode = true;
#else
bool Debug::m_bPrintOpcode = false;
#endif
#ifdef HMD__DEBUG_MARK_TREE
bool Debug::m_bPrintMarkTree = false;
int Debug::m_printMarkTreeLevel = 0;
#endif
MemPool* Debug::getDebugMemPool(void)
{
if (m_debugMemPool != NULL)
return m_debugMemPool;
return gMemPool;
}
#ifdef HY_TOOLS_BUILD
void Debug::printAllStackTrace(void)
{
HMD_FATAL_ERROR("Debug::printAllStackTrace() is not available");
}
#else
void Debug::printAllStackTrace(void)
{
gThreadManager.printAllStackTrace();
}
#endif
#else
MemPool* Debug::getDebugMemPool(void)
{
return gMemPool;
}
#endif