• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision265 (tree)
Time2012-01-19 23:27:17
Authorshirayanagi

Log Message

nacl 更新
RtlCaptureStackBackTrace 対応
iutest v0.15.0.2
 namespace 整理
 コメント修正

autoexp.dat 用ファイル追加・修正

Change Summary

Incremental Difference

--- trunk/utility/visual_studio/autoexp/cpp/nullptr.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/cpp/nullptr.txt (revision 265)
@@ -0,0 +1,9 @@
1+;------------------------------------------------------------------------------
2+; nullptr_t
3+;------------------------------------------------------------------------------
4+nullptr_t {
5+ preview
6+ (
7+ 0
8+ )
9+}
--- trunk/utility/visual_studio/autoexp/win32/error.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/win32/error.txt (revision 265)
@@ -0,0 +1,17 @@
1+;------------------------------------------------------------------------------
2+; iris::wx::CScopedLastError|iris::wx::CLastError
3+;------------------------------------------------------------------------------
4+iris::wx::CScopedLastError|iris::wx::CLastError {
5+ children
6+ (
7+ #(
8+ [actual members]: [$e,!],
9+ LASTERROR : [$e.m_LastError, hr]
10+ )
11+ )
12+ preview
13+ (
14+ [$e.m_LastError, hr]
15+ )
16+}
17+
--- trunk/utility/visual_studio/autoexp/mfc/list.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/mfc/list.txt (revision 265)
@@ -0,0 +1,22 @@
1+;------------------------------------------------------------------------------
2+; CList
3+;------------------------------------------------------------------------------
4+CList<*>|CObList|CPtrList|CStringList|CTypedPtrList<*> {
5+ children
6+ (
7+ #(
8+ #list
9+ (
10+ head: $e.m_pNodeHead,
11+ next: pNext
12+ ) : $e.data,
13+ #(
14+ [actual members] : [$e,!]
15+ )
16+ )
17+ )
18+ preview
19+ (
20+ [$e,!]
21+ )
22+}
--- trunk/utility/visual_studio/autoexp/mfc/map.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/mfc/map.txt (revision 265)
@@ -0,0 +1,40 @@
1+;------------------------------------------------------------------------------
2+; CMap
3+;------------------------------------------------------------------------------
4+CMap<*>::CAssoc {
5+ children
6+ (
7+ #(
8+ key : $e.key,
9+ value : $e.value,
10+ [actual members]: [$e,!]
11+ )
12+ )
13+ preview
14+ (
15+ #(
16+ "key = ", $e.key,
17+ ", value = ", $e.value
18+ )
19+ )
20+}
21+
22+CMap<*>|CMapPtrToWord|CMapPtrToPtr|CMapStringToOb|CMapStringToPtr|CMapStringToString|CMapWordToOb|CMapWordToPtr|CTypedPtrMap<*> {
23+ children
24+ (
25+ #(
26+ #array
27+ (
28+ expr : ($e.m_pHashTable)[$i],
29+ size : $e.m_nHashTableSize
30+ ) : #list
31+ (
32+ head : $e,
33+ next : pNext
34+ ) : $e,
35+ #(
36+ [actual members]: [$e,!]
37+ )
38+ )
39+ )
40+}
--- trunk/utility/visual_studio/autoexp/mfc/array.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/mfc/array.txt (revision 265)
@@ -0,0 +1,45 @@
1+;------------------------------------------------------------------------------
2+; CArray
3+;------------------------------------------------------------------------------
4+CArray<*>|CObArray|CByteArray|CDWordArray|CPtrArray|CStringArray|CWordArray|CUIntArray|CTypedPtrArray<*> {
5+ children
6+ (
7+ #(
8+ #array
9+ (
10+ expr : ($e.m_pData)[$i],
11+ size : $e.m_nSize
12+ ),
13+ #(
14+ [actual members]: [$e,!]
15+ )
16+ )
17+ )
18+ preview
19+ (
20+ #if($e.m_nSize > 10)
21+ (
22+ #(
23+ "[", $e.m_nSize, "](",
24+ #array
25+ (
26+ expr : ($e.m_pData)[$i],
27+ size : 10
28+ ),
29+ "...)"
30+ )
31+ )
32+ #else
33+ (
34+ #(
35+ "[", $e.m_nSize, "](",
36+ #array
37+ (
38+ expr : ($e.m_pData)[$i],
39+ size : $e.m_nSize
40+ ),
41+ ")"
42+ )
43+ )
44+ )
45+}
--- trunk/utility/visual_studio/autoexp/iris/accessor.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/accessor.txt (revision 265)
@@ -0,0 +1,14 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CAccessor
3+;------------------------------------------------------------------------------
4+iris::fnd::CAccessor<*> {
5+ preview
6+ (
7+ #if ($e.m_ptr == 0 ) (
8+ "?"
9+ ) #else (
10+ *$e.m_ptr
11+ )
12+ )
13+}
14+
--- trunk/utility/visual_studio/autoexp/iris/list.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/list.txt (revision 265)
@@ -0,0 +1,64 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CListNode
3+;------------------------------------------------------------------------------
4+iris::fnd::CListNode<*> {
5+ children
6+ (
7+ #(
8+ m_value : $e.m_value,
9+ m_pPrev : (iris::fnd::CListNode<$T1>*)$e.m_pPrev,
10+ m_pNext : (iris::fnd::CListNode<$T1>*)$e.m_pNext
11+ )
12+ )
13+ preview
14+ (
15+ $e.m_value
16+ )
17+}
18+
19+;------------------------------------------------------------------------------
20+; iris::fnd::CList
21+;------------------------------------------------------------------------------
22+iris::fnd::CList<*> {
23+ children
24+ (
25+ #(
26+ #list (
27+ head : $c.m_Node.m_pNext,
28+ size : $c.m_nSize,
29+ next : m_pNext
30+ ),
31+ #(
32+ [actual members]: [$e,!]
33+ )
34+ )
35+ )
36+ preview
37+ (
38+ #if($e.m_nSize > 10)
39+ (
40+ #(
41+ "[", $e.m_nSize, "](",
42+ #list
43+ (
44+ head : $c.m_Node.m_pNext,
45+ size : 10
46+ next : m_pNext
47+ ),
48+ "...)"
49+ )
50+ )
51+ #else
52+ (
53+ #(
54+ "[", $e.m_nSize, "](",
55+ #list (
56+ head : $c.m_Node.m_pNext,
57+ size : $c.m_nSize,
58+ next : m_pNext
59+ ),
60+ ")"
61+ )
62+ )
63+ )
64+}
\ No newline at end of file
--- trunk/utility/visual_studio/autoexp/iris/smart_ptr.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/smart_ptr.txt (revision 265)
@@ -0,0 +1,75 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CAutoPtr
3+;------------------------------------------------------------------------------
4+iris::fnd::CAutoPtr<*,*> {
5+ children
6+ (
7+ #(
8+ [actual members]: [$e,!],
9+ m_ptr : ($T1*)($e.m_ptr)
10+ )
11+ )
12+ preview
13+ (
14+ $e.m_ptr
15+ )
16+}
17+
18+;------------------------------------------------------------------------------
19+; iris::fnd::CLinkPtr
20+;------------------------------------------------------------------------------
21+iris::fnd::CLinkPtr<*,*> {
22+ children
23+ (
24+ #(
25+ [actual members]: [$e,!],
26+ m_ptr : ($T1*)($e.m_ptr)
27+ )
28+ )
29+ preview
30+ (
31+ $e.m_ptr
32+ )
33+}
34+
35+;------------------------------------------------------------------------------
36+; iris::fnd::CRefPtr
37+;------------------------------------------------------------------------------
38+iris::fnd::CRefPtr<*,*,*> {
39+ children
40+ (
41+ #(
42+ [actual members]: [$e,!],
43+ ptr : ($T1*)($e.m_ref->m_ptr),
44+ refcnt : $e.m_ref->m_refcnt
45+ )
46+ )
47+ preview
48+ (
49+ #if ($e.m_ref == 0) (
50+ "?"
51+ ) #else (
52+ #(
53+ "[", $e.m_ref->m_ptr, "] (", $e.m_ref->m_refcnt, ")"
54+ )
55+ )
56+ )
57+}
58+
59+;------------------------------------------------------------------------------
60+; iris::fnd::CLiberatorObject, iris::fnd::CLiberatorObject
61+;------------------------------------------------------------------------------
62+iris::fnd::CLiberatorObject<*>|iris::fnd::CLiberatorCRTP<*> {
63+ children
64+ (
65+ #(
66+ [actual members]: [$e,!],
67+ m_ptr : ($T1*)($e.m_ptr)
68+ )
69+ )
70+ preview
71+ (
72+ $e.m_ptr
73+ )
74+}
75+
--- trunk/utility/visual_studio/autoexp/iris/array.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/array.txt (revision 265)
@@ -0,0 +1,44 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CArray
3+;------------------------------------------------------------------------------
4+iris::fnd::CArray<*> {
5+ children
6+ (
7+ #(
8+ [actual members]: [$e,!],
9+ m_nSize : $e.m_nSize,
10+ #array
11+ (
12+ expr : ($e.m_pArray)[$i],
13+ size : $e.m_nSize
14+ )
15+ )
16+ )
17+ preview
18+ (
19+ #if($e.m_nSize > 10)
20+ (
21+ #(
22+ "[", $e.m_nSize, "](",
23+ #array
24+ (
25+ expr : ($e.m_pArray)[$i],
26+ size : 10
27+ ),
28+ "...)"
29+ )
30+ )
31+ #else
32+ (
33+ #(
34+ "[", $e.m_nSize, "](",
35+ #array
36+ (
37+ expr : ($e.m_pArray)[$i],
38+ size : $e.m_nSize
39+ ),
40+ ")"
41+ )
42+ )
43+ )
44+}
--- trunk/utility/visual_studio/autoexp/iris/color.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/color.txt (revision 265)
@@ -0,0 +1,22 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CColor
3+;------------------------------------------------------------------------------
4+iris::fnd::CColor<*,*,*,*,*,*,*,*,*>|CRgbaColor<*,*,*,*,*,*,*,*,*> {
5+ children
6+ (
7+ #(
8+ R : (($e.m_col >> ($e.SFT_R)) & ((1 << ($e.BSZ_R))-1)),
9+ G : (($e.m_col >> ($e.SFT_G)) & ((1 << ($e.BSZ_G))-1)),
10+ B : (($e.m_col >> ($e.SFT_B)) & ((1 << ($e.BSZ_B))-1)),
11+ A : (($e.m_col >> ($e.SFT_A)) & ((1 << ($e.BSZ_A))-1)),
12+ m_col : $e.m_col
13+ )
14+ )
15+ preview
16+ (
17+ #(
18+ $e.m_col
19+ )
20+ )
21+}
22+
--- trunk/utility/visual_studio/autoexp/iris/tree.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/iris/tree.txt (revision 265)
@@ -0,0 +1,41 @@
1+;------------------------------------------------------------------------------
2+; iris::fnd::CRBTree
3+;------------------------------------------------------------------------------
4+iris::fnd::CRBTree<*> {
5+ children
6+ (
7+ #(
8+ [actual members]: [$e,!],
9+ m_root : $e.m_root
10+ )
11+ )
12+ preview
13+ (
14+ #(
15+ [$e,!]
16+ )
17+ )
18+}
19+
20+;------------------------------------------------------------------------------
21+; iris::fnd::CRBTreeNode
22+;------------------------------------------------------------------------------
23+iris::fnd::CRBTreeNode<*> {
24+ children
25+ (
26+ #(
27+ [actual members]: [$e,!],
28+ m_pParent : (iris::fnd::CRBTreeNode<$T1>*)$e.m_pParent,
29+ m_pLeft : (iris::fnd::CRBTreeNode<$T1>*)$e.m_pLeft,
30+ m_pRight : (iris::fnd::CRBTreeNode<$T1>*)$e.m_pRight,
31+ m_Color : $e.m_Color,
32+ m_value : $e.m_value
33+ )
34+ )
35+ preview
36+ (
37+ #(
38+ [$e,!]
39+ )
40+ )
41+}
--- trunk/utility/visual_studio/autoexp/readme.txt (nonexistent)
+++ trunk/utility/visual_studio/autoexp/readme.txt (revision 265)
@@ -0,0 +1,2 @@
1+; 場所: Microsoft Visual Studio *\Common7\Packages\Debugger\autoexp.dat
2+: に、各ファイルの内容を、autoexp.dat の [Visualizer] 以降に追記してください。
--- trunk/framework/sample/Windows/unittest/src/nacl_test/file/main.cpp (revision 264)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/file/main.cpp (revision 265)
@@ -55,7 +55,7 @@
5555 if( m_file.Open("/test", fnd::FOPEN_RW | fnd::FOPEN_CREATE) )
5656 {
5757 int32_t ret = m_file.Write(buf.c_str(), buf.length());
58- OutputDebugVar(buf);
58+ PostMessage(buf);
5959 return ret;
6060 }
6161 return true;
--- trunk/framework/sample/Windows/unittest/src/nacl_test/file/index.html (revision 264)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/file/index.html (revision 265)
@@ -22,7 +22,7 @@
2222 }
2323
2424 function moduleDidLoad() {
25- hModule = document.getElementById('input');
25+ hModule = document.getElementById('file');
2626 // Add a message handler that accepts messages coming from the NaCl
2727 // module.
2828 hModule.addEventListener('message', handleMessage, true);
@@ -94,7 +94,7 @@
9494 method="get"
9595 onsubmit="return reverseText()">
9696 <input type="text" id="inputBox" name="inputBox" value="Hello world" />
97- <input type="button" value="Call fileWrite()" onclick="fileWrite()" />
97+ <input type="button" value="Call writeFile()" onclick="writeFile()" />
9898 </form>
9999 <!-- Load the published .nexe. This includes the 'src' attribute which
100100 shows how to load multi-architecture modules. Each entry in the "nexes"
@@ -120,7 +120,7 @@
120120
121121 <embed name="nacl_module"
122122 id="file"
123- width="400" height="400"
123+ width="0" height="0"
124124 src="file.nmf"
125125 type="application/x-nacl"
126126 style="background-color:gray" />
--- trunk/framework/sample/Windows/unittest/src/nacl_test/test/test.html (revision 264)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/test/test.html (revision 265)
@@ -13,7 +13,9 @@
1313
1414 <script type="text/javascript">
1515 hModule = null; // Global application object.
16- statusText = 'NO-STATUS';
16+ statusText = 'NO-STATUS';
17+ var kMaxArraySize = 20;
18+ var messageArray = new Array();
1719
1820 function moduleDidLoad() {
1921 hModule = document.getElementById('test');
@@ -21,11 +23,19 @@
2123 // module.
2224 hModule.addEventListener('message', handleMessage, false);
2325 updateStatus('SUCCESS');
24- }
25-
26+ }
27+
2628 // Handle a message coming from the NaCl module.
27- function handleMessage(message_event) {
28- alert(message_event.data);
29+ function handleMessage(message) {
30+ // Show last |kMaxArraySize| events in html.
31+ messageArray.push(message.data);
32+ if (messageArray.length > kMaxArraySize) {
33+ messageArray.shift();
34+ }
35+ var newData = messageArray.join('<BR>');
36+ document.getElementById('eventString').innerHTML = newData;
37+ // Print event to console.
38+ console.log(message.data);
2939 }
3040
3141 // If the page loads before the Native Client module loads, then set the
@@ -121,12 +131,15 @@
121131
122132 <embed name="nacl_module"
123133 id="test"
124- width=0 height=0
134+ width="0" height="0"
125135 src="test.nmf"
126136 type="application/x-nacl" />
127137 </div>
128138
129139 </p>
140+<h2>Events</h2>
141+<p><b id='eventString'>None</b></p>
142+
130143 <h2>Status</h2>
131144 <div id="status_field">NO-STATUS</div>
132145 </body>
--- trunk/framework/sample/Windows/unittest/src/nacl_test/index.html (revision 264)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/index.html (revision 265)
@@ -30,6 +30,7 @@
3030 <dt><a href="hash/hash.html">Hash</a></dt>
3131 <dt><a href="prime/prime.html">is prime number</a></dt>
3232 <dt><a href="input/index.html">input</a></dt>
33+ <dt><a href="file/index.html">file</a></dt>
3334 <dt><a href="test/test.html">test</a></dt>
3435 </dl>
3536 </body>
--- trunk/framework/src/platform/windows/win/wx_support.h (revision 264)
+++ trunk/framework/src/platform/windows/win/wx_support.h (revision 265)
@@ -165,9 +165,11 @@
165165
166166 #if defined(_WIN64)
167167 typedef DWORD64 XDWORD;
168+typedef PDWORD64 PXDWORD;
168169 typedef ULONG64 XULONG;
169170 #else
170171 typedef DWORD XDWORD;
172+typedef PDWORD PXDWORD;
171173 typedef ULONG XULONG;
172174 #endif
173175
--- trunk/framework/src/platform/windows/win/os/modules/WXMNtDll.h (nonexistent)
+++ trunk/framework/src/platform/windows/win/os/modules/WXMNtDll.h (revision 265)
@@ -0,0 +1,96 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file WXMNtDll.h
5+ * @brief NtDll モジュール ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_WXMNtDll_H_
18+#define INCG_IRIS_WXMNtDll_H_
19+
20+//======================================================================
21+// include
22+#include "../WXModule.h"
23+
24+namespace iris {
25+namespace wx
26+{
27+
28+//======================================================================
29+// class
30+/**
31+ * @brief NtDll モジュールクラス
32+*/
33+class CNtDllModule : private INonCopyable<CNtDllModule>
34+{
35+ CModule m_Module;
36+private:
37+ // コンストラクタ
38+ CNtDllModule(void) { Load(); }
39+
40+ // インスタンスの取得
41+ static CNtDllModule& GetInstance(void) { static CNtDllModule NtDll; return NtDll; }
42+ // モジュールのロード
43+ BOOL Load(void)
44+ {
45+ if( m_Module.IsValid() ) return TRUE;
46+ return m_Module.Load(IRIS_TEXT("ntdll.dll"));
47+ }
48+ // モジュールのアンロード
49+ BOOL Unload(void)
50+ {
51+ return m_Module.Release();
52+ }
53+
54+#define PROC_LOAD(_ret, _name, _args, _err) \
55+ typedef _ret (__stdcall *pfn##_name)##_args; \
56+ static pfn##_name pfnProc = nullptr; \
57+ do { \
58+ if( pfnProc == nullptr ) { \
59+ GetInstance().Load(); \
60+ pfnProc = GetProcAddress<pfn##_name>(#_name); \
61+ if( pfnProc == nullptr ) return _err; \
62+ } } while(0)
63+
64+public:
65+ /**
66+ * @name wrap
67+ * @{
68+ */
69+ static WORD RtlCaptureStackBackTrace(DWORD FramesToSkip, DWORD FramesToCapture, PVOID *BackTrace, PDWORD BackTraceHash)
70+ {
71+ PROC_LOAD(WORD, RtlCaptureStackBackTrace, (DWORD FramesToSkip, DWORD FramesToCapture, PVOID *BackTrace, PDWORD BackTraceHash), 0);
72+ return pfnProc(FramesToSkip, FramesToCapture, BackTrace, BackTraceHash);
73+ }
74+
75+ /**
76+ * @}
77+ */
78+
79+#undef PROC_LOAD
80+
81+public:
82+ // アドレス取得
83+ template<typename F, typename CHARTYPE_>
84+ static F GetProcAddress(const CHARTYPE_ * lpProcName)
85+ {
86+IRIS_MSC_PRAGMA_WARNING_BEGIN()
87+IRIS_MSC_PRAGMA_WARNING_DISABLE(4191) // PROC から hoge への変換は保証されません。
88+ return reinterpret_cast<F>(GetInstance().m_Module.GetProcAddress(lpProcName));
89+IRIS_MSC_PRAGMA_WARNING_END()
90+ }
91+};
92+
93+} // end of namespace wx
94+} // end of namespace iris
95+
96+#endif
--- trunk/framework/src/platform/windows/win/os/modules/WXMDbgHelp.h (revision 264)
+++ trunk/framework/src/platform/windows/win/os/modules/WXMDbgHelp.h (revision 265)
@@ -38,9 +38,6 @@
3838 {
3939 CModule m_Module;
4040 #if defined(_IMAGEHLP64)
41- typedef DWORD64 XDWORD;
42- typedef PDWORD64 PXDWORD;
43- typedef ULONG64 XULONG;
4441 typedef PIMAGEHLP_LINE64 PXIMAGEHLP_LINE;
4542 typedef PIMAGEHLP_SYMBOL64 PXIMAGEHLP_SYMBOL;
4643 typedef PSYM_ENUMSYMBOLS_CALLBACK64 PXSYM_ENUMSYMBOLS_CALLBACK;
@@ -47,9 +44,6 @@
4744 typedef PSYM_ENUMSYMBOLS_CALLBACK64W PXSYM_ENUMSYMBOLS_CALLBACKW;
4845 typedef PSYM_ENUMMODULES_CALLBACK64 PXSYM_ENUMMODULES_CALLBACK;
4946 #else
50- typedef DWORD XDWORD;
51- typedef PDWORD PXDWORD;
52- typedef ULONG XULONG;
5347 typedef PIMAGEHLP_LINE PXIMAGEHLP_LINE;
5448 typedef PIMAGEHLP_SYMBOL PXIMAGEHLP_SYMBOL;
5549 typedef PSYM_ENUMSYMBOLS_CALLBACK PXSYM_ENUMSYMBOLS_CALLBACK;
--- trunk/framework/src/platform/windows/win/os/WXModule.h (revision 264)
+++ trunk/framework/src/platform/windows/win/os/WXModule.h (revision 265)
@@ -66,7 +66,6 @@
6666 DWORD GetFileName(CHARTYPE_ (&lpszFileName)[SIZE_]) const { return GetFileName(lpszFileName, SIZE_); }
6767 };
6868
69-
7069 } // end of namespace wx
7170 } // end of namespace iris
7271
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.h (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.h (revision 265)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -64,7 +64,10 @@
6464 public:
6565 // シンボル名の取得
6666 template<typename CHARTYPE_>
67- bool GetSymbolName(CHARTYPE_* lpszSymbolName, u32 length) const;
67+ bool GetSymbolName(CHARTYPE_* lpszSymbolName, u32 length) const
68+ {
69+ return m_Symbol.GetSymNameFromAddr(m_Frame.AddrPC.Offset, lpszSymbolName, length);
70+ }
6871 // ライン情報の取得
6972 bool GetLine(PIMAGEHLP_LINE lpihl) const;
7073
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXProcHook.cpp (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXProcHook.cpp (revision 265)
@@ -121,51 +121,29 @@
121121 {
122122 Close();
123123
124- do
124+ // Import Entry から探す
125125 {
126126 CImageDirectoryEntry<IMAGE_DIRECTORY_ENTRY_IMPORT> pidesc((PVOID)hModule, TRUE);
127- if( pidesc == nullptr ) break;
128-
129- while( pidesc->Name )
127+ PROC* ppfn = pidesc.FindProcAddress(pfnTarget, hModule);
128+ if( ppfn != nullptr )
130129 {
131-#if 1 // デバッグ、最適化用
132- LPCSTR lpName = pointer_cast<LPCSTR>((PBYTE)hModule + pidesc->Name);
133- IRIS_UNUSED_VAR(lpName);
134-#endif
135- PIMAGE_THUNK_DATA pitd = pointer_cast<PIMAGE_THUNK_DATA>((PBYTE)hModule + pidesc->FirstThunk);
136-
137- while( pitd->u1.Function )
138- {
139- PROC* ppfn = pointer_cast<PROC*>(&pitd->u1.Function);
140- if( *ppfn == pfnTarget )
141- {
142- m_ppAddress = ppfn;
143- m_pfnOrigin = *ppfn;
144- return true;
145- }
146- ++pitd;
147- }
148- ++pidesc;
130+ m_ppAddress = ppfn;
131+ m_pfnOrigin = *ppfn;
132+ return true;
149133 }
150- } while(0);
134+ }
151135
152136 // IAT から探す
153- do
154137 {
155138 CImageDirectoryEntry<IMAGE_DIRECTORY_ENTRY_IAT> pidesc((PVOID)hModule, TRUE);
156- if( pidesc == nullptr ) break;
157-
158- for( ULONG i=0, count=pidesc.GetCount(); i < count; ++i, ++pidesc )
139+ PROC* ppfn = pidesc.FindProcAddress(pfnTarget, hModule);
140+ if( ppfn != nullptr )
159141 {
160- PROC* ppfn = pointer_cast<PROC*>(pidesc);
161- if( *ppfn == pfnTarget )
162- {
163- m_ppAddress = ppfn;
164- m_pfnOrigin = *ppfn;
165- return true;
166- }
142+ m_ppAddress = ppfn;
143+ m_pfnOrigin = *ppfn;
144+ return true;
167145 }
168- } while(0);
146+ }
169147 return false;
170148 }
171149
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackTrace.cpp (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackTrace.cpp (revision 265)
@@ -9,7 +9,7 @@
99 *
1010 *
1111 * @par copyright
12- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
12+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1313 * The new BSD License is applied to this software.
1414 * see iris_LICENSE.txt
1515 */
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (revision 265)
@@ -39,6 +39,7 @@
3939 template<USHORT DE>struct type_impl { typedef DWORD value_type; };
4040 template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_IMPORT> { typedef IMAGE_IMPORT_DESCRIPTOR value_type; };
4141 template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_EXPORT> { typedef IMAGE_EXPORT_DIRECTORY value_type; };
42+ template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_IAT> { typedef PROC value_type; };
4243
4344 public:
4445 typedef typename type_impl<ENTRY>::value_type value_type;
@@ -65,11 +66,11 @@
6566 }
6667
6768 public:
68- value_ref operator * (void) { return *m_pEntry; }
69- value_ptr operator -> (void) { return m_pEntry; }
70- value_ptr ptr(void) { return m_pEntry; }
69+ value_ref operator * (void) { return *m_pEntry; }
70+ value_ptr operator -> (void) const { return m_pEntry; }
71+ value_ptr ptr(void) const { return m_pEntry; }
7172
72- operator value_ptr (void) { return m_pEntry; }
73+ operator value_ptr (void) const { return m_pEntry; }
7374
7475 public:
7576 _Myt& operator ++ (void) { ++m_pEntry; return *this; }
@@ -82,6 +83,10 @@
8283 ULONG GetCount(void) const { return m_nSize / sizeof(value_type); }
8384
8485 public:
86+ /// 有効なオブジェクトかどうか
87+ bool IsValid(void) const { return m_pEntry != nullptr; }
88+
89+public:
8590 /// データ取得
8691 static value_ptr ToData(PVOID pBase, BOOLEAN bMappedAsImage, PULONG pSize)
8792 {
@@ -93,6 +98,95 @@
9398 ULONG uSize = 0;
9499 return ToData(pBase, bMappedAsImage, &uSize);
95100 }
101+
102+public:
103+ /**
104+ * @brief 関数ポインターの検索
105+ * @param [in] pfnTarget = 検索関数ポインター
106+ * @param [in] hModule = 検索モジュール(検索時に利用する)
107+ */
108+ PROC* FindProcAddress(PROC pfnTarget, HMODULE hModule)
109+ {
110+ return Finder::Find(*this, pfnTarget, hModule);
111+ }
112+
113+public:
114+ /**
115+ * @brief 関数ポインターの検索
116+ * @param [in] pfnTarget = 検索関数ポインター
117+ * @param [in] hModule = 検索モジュール(検索時に利用する)
118+ */
119+ static PROC* FindProcAddress(PROC pfnTarget, HMODULE hModule, BOOLEAN bMappedAsImage)
120+ {
121+ return Finder::Find(pfnTarget, hModule, bMappedAsImage);
122+ }
123+
124+private:
125+ /**
126+ * @biref 関数ポインター格納アドレス検索クラス
127+ */
128+ class Finder
129+ {
130+ template<typename T, typename DMY>
131+ struct impl;
132+ template<typename DMY>
133+ struct impl<PROC, DMY>
134+ {
135+ static PROC* Find(_Myt& pidesc, PROC pfnTarget, HMODULE hModule)
136+ {
137+ if( pidesc == nullptr ) return nullptr;
138+
139+ for( ULONG i=0, count=pidesc.GetCount(); i < count; ++i, ++pidesc )
140+ {
141+ PROC* ppfn = pointer_cast<PROC*>(pidesc);
142+ if( *ppfn == pfnTarget )
143+ {
144+ return ppfn;
145+ }
146+ }
147+ return nullptr;
148+ }
149+ };
150+ template<typename DMY>
151+ struct impl<IMAGE_IMPORT_DESCRIPTOR, DMY>
152+ {
153+ static PROC* Find(_Myt& pidesc, PROC pfnTarget, HMODULE hModule)
154+ {
155+ if( pidesc == nullptr ) return nullptr;
156+
157+ while( pidesc->Name )
158+ {
159+#if 1 // デバッグ、最適化用
160+ LPCSTR lpName = pointer_cast<LPCSTR>((PBYTE)hModule + pidesc->Name);
161+ IRIS_UNUSED_VAR(lpName);
162+#endif
163+ PIMAGE_THUNK_DATA pitd = pointer_cast<PIMAGE_THUNK_DATA>((PBYTE)hModule + pidesc->FirstThunk);
164+
165+ while( pitd->u1.Function )
166+ {
167+ PROC* ppfn = pointer_cast<PROC*>(&pitd->u1.Function);
168+ if( *ppfn == pfnTarget )
169+ {
170+ return ppfn;
171+ }
172+ ++pitd;
173+ }
174+ ++pidesc;
175+ }
176+ return nullptr;
177+ }
178+ };
179+ public:
180+ static PROC* Find(_Myt& pidesc, PROC pfnTarget, HMODULE hModule)
181+ {
182+ return impl<value_type, void>::Find(pidesc, pfnTarget, hModule);
183+ }
184+ static PROC* Find(PROC pfnTarget, HMODULE hModule, BOOLEAN bMappedAsImage)
185+ {
186+ _Myt pidesc((PVOID)hModule, bMappedAsImage);
187+ return Find(pidesc, pfnTarget, hModule);
188+ }
189+ };
96190 };
97191
98192 } // end of namespace wx
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.cpp (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.cpp (revision 265)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -25,9 +25,11 @@
2525 #include "../../../../../fnd/container/FndScopedLock.h"
2626 #include "WXStackTrace.h"
2727 #include "WXSymbol.h"
28+#include "../../rtl/WXRtlBackTrace.h"
2829 #include "../WXDebugLeakCheckMacro.h"
2930 #include "../../os/WXCriticalSection.h"
3031 #include "../../base/WXError.h"
32+#include "../../../../../iris_xchar.hpp"
3133 #include "../../../../../iris_debug.h"
3234 #include <tchar.h>
3335
@@ -80,6 +82,8 @@
8082
8183 // 厳密にスタックを追う場合は 1
8284 #define CHECK_STRICT 0
85+// RunTime Library を使う場合は 1
86+#define USE_RTL 1
8387
8488 //======================================================================
8589 // class
@@ -205,7 +209,9 @@
205209 // リストに追加
206210 void Add(void* lpObject, PROC pfnClose)
207211 {
212+#if !USE_RTL
208213 CObjLeakCheckStackTrace st;
214+#endif
209215
210216 CScopedLastError e;
211217 IRIS_ASSERT(m_Heap != nullptr);
@@ -218,30 +224,70 @@
218224
219225 CCSScopedLock lock(m_CS);
220226
221- bool origin = HOOK_VARIABLE_NAME(CreateThread).IsOrigin();
222- if( !origin )
227+#if USE_RTL // use RunTime Library
223228 {
224- HOOK_VARIABLE_NAME(CreateThread).Reset(); // 退避
229+ const int kBackTraceCount = 10;
230+ CRTLBackTrace<kBackTraceCount> backtrace;
231+ bool find = false;
232+ for( WORD i=0; i < backtrace.GetCount(); ++i )
233+ {
234+ DWORD dwAddr = (DWORD)backtrace[i];
235+ IMAGEHLP_LINE line = { sizeof(IMAGEHLP_LINE) };
236+ XDWORD disp=0;
237+ if( m_Symbol.GetLineFromAddr(dwAddr, &disp, &line) )
238+ {
239+ if( strstr(line.FileName, "wxobjleakcheck.cpp") != nullptr )
240+ {
241+ find = true;
242+ }
243+ else
244+ {
245+ if( find )
246+ {
247+ // ファイル属性で判定
248+ DWORD dwAttr = ::GetFileAttributesA(line.FileName);
249+ if( dwAttr != (DWORD)-1 )
250+ {
251+ xcstoxcs_s(p->file, MAX_PATH, line.FileName);
252+ p->line = line.LineNumber;
253+ goto find;
254+ }
255+ }
256+ }
257+ }
258+ }
259+ p->file[0] = '\0';
260+ p->line = 0;
261+find:
262+ (void)0;
225263 }
264+#else
265+ {
266+ bool origin = HOOK_VARIABLE_NAME(CreateThread).IsOrigin();
267+ if( !origin )
268+ {
269+ HOOK_VARIABLE_NAME(CreateThread).Reset(); // 退避
270+ }
226271 #if CHECK_STRICT
227- if( st.Trace(1, CStackTrace::SKIP_UNKOWN_SOURCE|CStackTrace::EXAMINE_EACH) )
272+ if( st.Trace(1, CStackTrace::SKIP_UNKOWN_SOURCE|CStackTrace::EXAMINE_EACH) )
228273 #else
229- if( st.Trace(7, CStackTrace::SKIP_UNKOWN_SOURCE) )
274+ if( st.Trace(7, CStackTrace::SKIP_UNKOWN_SOURCE) )
230275 #endif
231- {
232- _tcscpy_s(p->file, MAX_PATH, st.GetFileName());
233- _tcscpy_s(p->file, MAX_PATH, st.GetFileName());
234- p->line = st.GetLine();
276+ {
277+ _tcscpy_s(p->file, MAX_PATH, st.GetFileName());
278+ p->line = st.GetLine();
279+ }
280+ else
281+ {
282+ p->file[0] = '\0';
283+ p->line = 0;
284+ }
285+ if( !origin )
286+ {
287+ HOOK_VARIABLE_NAME(CreateThread).Revert(); // 戻す
288+ }
235289 }
236- else
237- {
238- p->file[0] = '\0';
239- p->line = 0;
240- }
241- if( !origin )
242- {
243- HOOK_VARIABLE_NAME(CreateThread).Revert(); // 戻す
244- }
290+#endif
245291 p->close = pfnClose;
246292 p->object = lpObject;
247293 p->count = m_AllocCount++;
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.cpp (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.cpp (revision 265)
@@ -20,6 +20,7 @@
2020 // include
2121 #include "WXSymbol.h"
2222 #include "WXDebugHelp.h"
23+#include "../../../../../iris_xchar.hpp"
2324
2425 namespace iris {
2526 namespace wx
@@ -237,6 +238,76 @@
237238
238239 /**********************************************************************//**
239240 *
241+ * シンボル名の取得
242+ *
243+ -----------------------------------------------------------------------
244+ * @param [out] lpszSymbolName = 出力バッファ
245+ * @param [in] length = 出力バッファ長
246+ * @return 成否
247+*//***********************************************************************/
248+template<>
249+bool CSymbol::GetSymNameFromAddr<CHAR>(XDWORD dwAddr, LPSTR lpszSymbolName, u32 length) const
250+{
251+ if( lpszSymbolName == nullptr ) return false;
252+#define USE_IMAGEHLP_SYMBOL
253+
254+#if defined(USE_IMAGEHLP_SYMBOL)
255+ typedef IMAGEHLP_SYMBOL SYMINFO;
256+#else
257+ typedef SYMINFO SYMINFO;
258+#endif
259+ SYMINFO* pSymbol = nullptr;
260+ u8 buffer[sizeof(SYMINFO) + MAX_SYM_NAME * sizeof(TCHAR)] = {0};
261+ pSymbol = pointer_cast<SYMINFO*>(buffer);
262+ pSymbol->SizeOfStruct = sizeof(SYMINFO);
263+#if defined(USE_IMAGEHLP_SYMBOL)
264+ pSymbol->MaxNameLength = MAX_SYM_NAME;
265+#else
266+ pSymbol->MaxNameLen = MAX_SYM_NAME;
267+#endif
268+
269+ XDWORD disp=0;
270+ if( GetSymFromAddr(dwAddr, &disp, (PIMAGEHLP_SYMBOL)pSymbol) )
271+ {
272+ lpszSymbolName[0] = 0;
273+ return false;
274+ }
275+ xcstoxcs_s(lpszSymbolName, length, pSymbol->Name);
276+ return true;
277+}
278+template<>
279+bool CSymbol::GetSymNameFromAddr<WCHAR>(XDWORD dwAddr, LPWSTR lpszSymbolName, u32 length) const
280+{
281+ if( lpszSymbolName == nullptr ) return false;
282+#define USE_IMAGEHLP_SYMBOL
283+
284+#if defined(USE_IMAGEHLP_SYMBOL)
285+ typedef IMAGEHLP_SYMBOL SYMINFO;
286+#else
287+ typedef SYMINFO SYMINFO;
288+#endif
289+ SYMINFO* pSymbol = nullptr;
290+ u8 buffer[sizeof(SYMINFO) + MAX_SYM_NAME * sizeof(TCHAR)] = {0};
291+ pSymbol = pointer_cast<SYMINFO*>(buffer);
292+ pSymbol->SizeOfStruct = sizeof(SYMINFO);
293+#if defined(USE_IMAGEHLP_SYMBOL)
294+ pSymbol->MaxNameLength = MAX_SYM_NAME;
295+#else
296+ pSymbol->MaxNameLen = MAX_SYM_NAME;
297+#endif
298+
299+ XDWORD disp=0;
300+ if( GetSymFromAddr(dwAddr, &disp, (PIMAGEHLP_SYMBOL)pSymbol) )
301+ {
302+ lpszSymbolName[0] = 0;
303+ return false;
304+ }
305+ xcstoxcs_s(lpszSymbolName, length, pSymbol->Name);
306+ return true;
307+}
308+
309+/**********************************************************************//**
310+ *
240311 * 指定されたアドレスに置かれているシンボルを検索
241312 *
242313 -----------------------------------------------------------------------
@@ -245,13 +316,9 @@
245316 * @param [out] pSymbol = 出力情報
246317 * @return 成否
247318 *//***********************************************************************/
248-BOOL CSymbol::GetSymFromAddr(XDWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL pSymbol) const
319+BOOL CSymbol::GetSymFromAddr(XDWORD dwAddr, PXDWORD pdwDisplacement, PIMAGEHLP_SYMBOL pSymbol) const
249320 {
250-#if defined(_IMAGEHLP64)
251- return CDbgHelpModule::SymGetSymFromAddr(m_hObject, dwAddr, (PDWORD64)pdwDisplacement, pSymbol);
252-#else
253321 return CDbgHelpModule::SymGetSymFromAddr(m_hObject, dwAddr, pdwDisplacement, pSymbol);
254-#endif
255322 }
256323
257324 /**********************************************************************//**
@@ -412,3 +479,4 @@
412479
413480 } // end of namespace wx
414481 } // end of namespace iris
482+
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.h (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.h (revision 265)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -74,8 +74,11 @@
7474 // 直前のソース行を取得
7575 BOOL GetLinePrev(PIMAGEHLP_LINE pLine) const;
7676
77+ // 指定されたアドレスのシンボル名の取得
78+ template<typename CHARTYPE_>
79+ bool GetSymNameFromAddr(XDWORD dwAddr, CHARTYPE_* lpszSymbolName, u32 length) const;
7780 // 指定されたアドレスに置かれているシンボルを検索
78- BOOL GetSymFromAddr(XDWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL pSymbol) const;
81+ BOOL GetSymFromAddr(XDWORD dwAddr, PXDWORD pdwDisplacement, PIMAGEHLP_SYMBOL pSymbol) const;
7982 // 指定された名前に対応するシンボルを検索
8083 BOOL GetSymFromName(LPSTR Name, PIMAGEHLP_SYMBOL pSymbol) const;
8184 // 次のシンボルを取得
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.cpp (revision 264)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.cpp (revision 265)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -213,76 +213,6 @@
213213
214214 /**********************************************************************//**
215215 *
216- * シンボル名の取得
217- *
218- -----------------------------------------------------------------------
219- * @param [out] lpszSymbolName = 出力バッファ
220- * @param [in] length = 出力バッファ長
221- * @return 成否
222-*//***********************************************************************/
223-template<>
224-bool CStackWalker::GetSymbolName<CHAR>(LPSTR lpszSymbolName, u32 length) const
225-{
226- if( lpszSymbolName == nullptr ) return false;
227-#define USE_IMAGEHLP_SYMBOL
228-
229-#if defined(USE_IMAGEHLP_SYMBOL)
230- typedef IMAGEHLP_SYMBOL SYMINFO;
231-#else
232- typedef SYMINFO SYMINFO;
233-#endif
234- SYMINFO* pSymbol = nullptr;
235- u8 buffer[sizeof(SYMINFO) + MAX_SYM_NAME * sizeof(TCHAR)] = {0};
236- pSymbol = pointer_cast<SYMINFO*>(buffer);
237- pSymbol->SizeOfStruct = sizeof(SYMINFO);
238-#if defined(USE_IMAGEHLP_SYMBOL)
239- pSymbol->MaxNameLength = MAX_SYM_NAME;
240-#else
241- pSymbol->MaxNameLen = MAX_SYM_NAME;
242-#endif
243-
244- DWORD disp=0;
245- if( m_Symbol.GetSymFromAddr(m_Frame.AddrPC.Offset, &disp, (PIMAGEHLP_SYMBOL)pSymbol) )
246- {
247- lpszSymbolName[0] = 0;
248- return false;
249- }
250- xcstoxcs_s(lpszSymbolName, length, pSymbol->Name);
251- return true;
252-}
253-template<>
254-bool CStackWalker::GetSymbolName<WCHAR>(LPWSTR lpszSymbolName, u32 length) const
255-{
256- if( lpszSymbolName == nullptr ) return false;
257-#define USE_IMAGEHLP_SYMBOL
258-
259-#if defined(USE_IMAGEHLP_SYMBOL)
260- typedef IMAGEHLP_SYMBOL SYMINFO;
261-#else
262- typedef SYMINFO SYMINFO;
263-#endif
264- SYMINFO* pSymbol = nullptr;
265- u8 buffer[sizeof(SYMINFO) + MAX_SYM_NAME * sizeof(TCHAR)] = {0};
266- pSymbol = pointer_cast<SYMINFO*>(buffer);
267- pSymbol->SizeOfStruct = sizeof(SYMINFO);
268-#if defined(USE_IMAGEHLP_SYMBOL)
269- pSymbol->MaxNameLength = MAX_SYM_NAME;
270-#else
271- pSymbol->MaxNameLen = MAX_SYM_NAME;
272-#endif
273-
274- DWORD disp=0;
275- if( m_Symbol.GetSymFromAddr(m_Frame.AddrPC.Offset, &disp, (PIMAGEHLP_SYMBOL)pSymbol) )
276- {
277- lpszSymbolName[0] = 0;
278- return false;
279- }
280- xcstoxcs_s(lpszSymbolName, length, pSymbol->Name);
281- return true;
282-}
283-
284-/**********************************************************************//**
285- *
286216 * ライン情報の取得
287217 *
288218 -----------------------------------------------------------------------
@@ -292,7 +222,7 @@
292222 bool CStackWalker::GetLine(PIMAGEHLP_LINE lpihl) const
293223 {
294224 IRIS_ASSERT( lpihl->SizeOfStruct== sizeof(IMAGEHLP_LINE) );
295- DWORD disp=0;
225+ XDWORD disp=0;
296226 if( !m_Symbol.GetLineFromAddr(m_Frame.AddrPC.Offset, &disp, lpihl) )
297227 {
298228 return false;
--- trunk/framework/src/platform/windows/win/rtl/WXRtlBackTrace.h (nonexistent)
+++ trunk/framework/src/platform/windows/win/rtl/WXRtlBackTrace.h (revision 265)
@@ -0,0 +1,54 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file WXRtlBackTrace.h
5+ * @brief WXRtlBackTrace ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_WXRtlBackTrace_H_
18+#define INCG_IRIS_WXRtlBackTrace_H_
19+
20+//======================================================================
21+// include
22+#include "../os/modules/WXMNtDll.h"
23+
24+namespace iris {
25+namespace wx
26+{
27+
28+/**
29+ * @brief RTL バックトレース
30+*/
31+template<int N>
32+class CRTLBackTrace : public IIrisObject
33+{
34+ static const int NUM = N;
35+
36+ void* m_Stack[N];
37+ WORD m_Count;
38+public:
39+ CRTLBackTrace(void)
40+ : m_Count(0)
41+ {
42+ m_Count = CNtDllModule::RtlCaptureStackBackTrace(2, NUM, m_Stack, nullptr);
43+ }
44+public:
45+ const void* GetAt(int index) const { return m_Stack[index]; }
46+ WORD GetCount(void) const { return m_Count; }
47+public:
48+ const void* operator [] (int index) const { return m_Stack[index]; }
49+};
50+
51+} // end of namespace wx
52+} // end of namespace iris
53+
54+#endif
--- trunk/framework/src/web/nacl/fs/NaclFile.h (revision 264)
+++ trunk/framework/src/web/nacl/fs/NaclFile.h (revision 265)
@@ -105,8 +105,8 @@
105105 */
106106 virtual bool Close(void)
107107 {
108+ m_File.Close();
108109 m_Ref.Close();
109- m_File.Close();
110110 return true;
111111 }
112112 /**
--- trunk/framework/src/web/nacl/fs/NaclFileIO.h (revision 264)
+++ trunk/framework/src/web/nacl/fs/NaclFileIO.h (revision 265)
@@ -176,6 +176,7 @@
176176 virtual void OnWrite(int32_t bytes_written)
177177 {
178178 IRIS_UNUSED_VAR(bytes_written);
179+ OutputDebugVar("OnWrite");
179180 OutputDebugVar(bytes_written);
180181 }
181182
--- trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 265)
@@ -22,17 +22,17 @@
2222
2323 //======================================================================
2424 // define
25-#define IUTEST_VER 0x00150001 //!< iutest version 0.15.0.1
25+#define IUTEST_VER 0x00150001 //!< iutest version 0.15.0.2
2626 #define IUTEST_MAJORVER 0x00
2727 #define IUTEST_MINORVER 0x15
2828 #define IUTEST_BUILD 0x00
29-#define IUTEST_REVISION 0x01
29+#define IUTEST_REVISION 0x02
3030
3131 /**
3232 * @file iutest_ver.h
3333 * @par release note
3434 <ul>
35- <li>v0.15.0.0
35+ <li>v0.15.0.2
3636 <ul>
3737 <li>型アサーション 対応</li>
3838 <li>RecoredProperty 対応</li>
--- trunk/framework/testsuite/iutest/include/iutest_typed_tests.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/iutest_typed_tests.h (revision 265)
@@ -55,7 +55,7 @@
5555 typedef iutest_TypeParam TypeParam; \
5656 protected: virtual void Body(void); \
5757 }; \
58- iutest::TypeParamTestInstance<IUTEST_TEST_CLASS_NAME_(testcase_, testname_), IUTEST_TYPED_TEST_PARAMS(testcase_)> \
58+ iutest::detail::TypeParamTestInstance<IUTEST_TEST_CLASS_NAME_(testcase_, testname_), IUTEST_TYPED_TEST_PARAMS(testcase_)> \
5959 s_##testcase_##_##testname_( #testcase_, #testname_); \
6060 template<typename iutest_TypeParam> \
6161 void IUTEST_TEST_CLASS_NAME_(testcase_, testname_)<iutest_TypeParam>::Body(void)
@@ -97,7 +97,7 @@
9797 #define IUTEST_TYPED_TEST_P_NAMESPACE(testcase_) iutest_typed_test_case_p_name_##testcase_##_
9898
9999 #define IUTEST_TYPED_TEST_CASE_P_(testcase_) \
100- static iutest::TypedTestCasePState IUTEST_TYPED_TEST_CASE_PSTATE_NAME(testcase_)
100+ static iutest::detail::TypedTestCasePState IUTEST_TYPED_TEST_CASE_PSTATE_NAME(testcase_)
101101
102102 #define IUTEST_TYPED_TEST_P_(testcase_, testname_) \
103103 namespace IUTEST_TYPED_TEST_P_NAMESPACE(testcase_) { \
@@ -122,7 +122,7 @@
122122
123123 #define IUTEST_INSTANTIATE_TYPED_TEST_CASE_P_(prefix_, testcase_, types_) \
124124 bool iutest_##prefix_##_##testcase_ IUTEST_ATTRIBUTE_UNUSED_ = \
125- iutest::TypeParameterizedTestCase<testcase_ \
125+ iutest::detail::TypeParameterizedTestCase<testcase_ \
126126 , IUTEST_TYPED_TEST_P_NAMESPACE(testcase_)::iutest_AllTests_ \
127127 , types_::type>::Register(#prefix_, #testcase_ \
128128 , IUTEST_TYPED_TEST_CASE_PSTATE_NAME(testcase_).names())
@@ -134,6 +134,9 @@
134134
135135 //======================================================================
136136 // class
137+namespace detail
138+{
139+
137140 /**
138141 * @private
139142 * @internal
@@ -362,6 +365,9 @@
362365 }
363366 };
364367
368+} // end of namespace detail
369+
370+
365371 } // end of namespace iutest
366372
367373 #endif
--- trunk/framework/testsuite/iutest/include/iutest_case.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/iutest_case.h (revision 265)
@@ -265,6 +265,9 @@
265265 friend class UnitTestImpl;
266266 };
267267
268+namespace detail
269+{
270+
268271 /**
269272 * @brief テストケース仲介者
270273 */
@@ -276,6 +279,8 @@
276279 virtual const char* test_case_name(void) const { return m_test_case->test_case_name(); }
277280 };
278281
282+} // end of namespace detail
283+
279284 } // end of namespace iutest
280285
281286 #endif
--- trunk/framework/testsuite/iutest/include/iutest_static_assertion.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/iutest_static_assertion.h (revision 265)
@@ -40,6 +40,10 @@
4040 //======================================================================
4141 // function
4242 #if 0
43+/**
44+ * @ingroup IUTEST_
45+ * @brief 型アサーション
46+*/
4347 template<typename T1, typename T2>
4448 static bool StaticAssertTypeEq(void)
4549 {
@@ -48,8 +52,12 @@
4852 }
4953 #else
5054
51-// マクロバージョン
52-// エラーが呼び出し位置に出る
55+/**
56+ * @ingroup IUTEST_
57+ * @brief 型アサーション
58+ * @note マクロバージョン
59+ * エラーが呼び出し位置に出る
60+*/
5361 #define StaticAssertTypeEq detail::StaticAssertTypeEqHelper
5462
5563 #endif
--- trunk/framework/testsuite/iutest/include/iutest_core.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/iutest_core.h (revision 265)
@@ -291,6 +291,9 @@
291291 friend class UnitTestSource;
292292 };
293293
294+namespace detail
295+{
296+
294297 /**
295298 * @private
296299 * @internal
@@ -309,11 +312,13 @@
309312 }
310313
311314 private:
312- TestCaseMediator m_mediator;
313- TestInfo m_info;
314- detail::iuFactory<Tester> m_factory;
315+ TestCaseMediator m_mediator;
316+ TestInfo m_info;
317+ iuFactory<Tester> m_factory;
315318 };
316319
320+} // end of namespace detail
321+
317322 } // end of namespace iutest
318323
319324 #endif
--- trunk/framework/testsuite/iutest/include/internal/iutest_runner.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_runner.h (revision 265)
@@ -90,7 +90,7 @@
9090 "--------------------------------------------------\n"
9191 "License\n"
9292 "\n"
93- " Copyright (c) 2011 Takazumi-Shirayanagi,\n"
93+ " Copyright (c) 2011-2012 Takazumi-Shirayanagi,\n"
9494 " All rights reserved.\n"
9595 "\n"
9696 " The new(modified) BSD License is applied to this software, see LICENSE\n"
--- trunk/framework/testsuite/iutest/include/internal/iutest_internal.h (revision 264)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_internal.h (revision 265)
@@ -38,7 +38,7 @@
3838 public: IUTEST_TEST_CLASS_NAME_(testcase_, testname_)(void) {} \
3939 protected: virtual void Body(void); \
4040 }; \
41- iutest::TestInstance<IUTEST_TEST_CLASS_NAME_(testcase_, testname_)> \
41+ iutest::detail::TestInstance<IUTEST_TEST_CLASS_NAME_(testcase_, testname_)> \
4242 s_##testcase_##_##testname_( #testcase_, #testname_ \
4343 , iutest::detail::GetTestTypeId<parent_>(), parent_::SetUpTestCase, parent_::TearDownTestCase); \
4444 void IUTEST_TEST_CLASS_NAME_(testcase_, testname_)::Body(void)
Show on old repository browser