• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision261 (tree)
Time2012-01-16 18:58:39
Authorshirayanagi

Log Message

iutest v0.14.0.2
警告除去

nacl 更新
dbghelp 関係更新

Change Summary

Incremental Difference

--- trunk/external/windows/setup/nacl/resetup_env.bat (revision 260)
+++ trunk/external/windows/setup/nacl/resetup_env.bat (revision 261)
@@ -5,6 +5,7 @@
55 call _setenv.bat
66
77 @echo NACL_SDK_ROOT> reset_enviroment.dat
8+@echo NACL_TARGET_PLATFORM>> enviroment.dat
89
910 call cscript.exe "%WSH_TOOLS_ROOT%\wsh_resetenv.wsf" reset_enviroment.dat
1011
--- trunk/external/windows/setup/nacl/setup_env.bat (revision 260)
+++ trunk/external/windows/setup/nacl/setup_env.bat (revision 261)
@@ -5,6 +5,7 @@
55 call _setenv.bat
66
77 @echo NACL_SDK_ROOT=%NACL_SDK_ROOT%> enviroment.dat
8+@echo NACL_TARGET_PLATFORM=pepper_15>> enviroment.dat
89
910 call cscript.exe "%WSH_TOOLS_ROOT%\wsh_setenv.wsf" enviroment.dat
1011
--- trunk/framework/sample/Windows/unittest/src/fnd_image_test/test_color.cpp (revision 260)
+++ trunk/framework/sample/Windows/unittest/src/fnd_image_test/test_color.cpp (revision 261)
@@ -20,6 +20,7 @@
2020 // include
2121 #include "unit/gt/gt_inchead.h"
2222 #include "fnd/image/FndColor.h"
23+#include "c++0x/cpp0x_type_traits.hpp"
2324 #include "iris_using.h"
2425
2526 TEST(FndColorTest, Construct)
@@ -192,3 +193,9 @@
192193 ASSERT_EQ( color[i], buf[i] );
193194 }
194195 }
196+
197+TYPED_TEST(FndColorTypesTest, is_pod)
198+{
199+ ASSERT_FALSE(cpp0x::is_pod<ParamType>::value);
200+}
201+
--- trunk/framework/sample/Windows/unittest/src/nacl_test/test/test.cpp (revision 260)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/test/test.cpp (revision 261)
@@ -61,6 +61,7 @@
6161 AddMethod("startSound", CMethodFactory::CreateMethod(this, &TestInstance::startSound));
6262 AddMethod("stopSound" , CMethodFactory::CreateMethod(this, &TestInstance::stopSound));
6363
64+ RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
6465 SetInputHandler(&m_Input);
6566 m_sound.SetFile(&m_wav);
6667 }
--- trunk/framework/sample/Windows/unittest/src/nacl_test/input/main.cpp (nonexistent)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/input/main.cpp (revision 261)
@@ -0,0 +1,79 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file test.cpp
5+ * @brief test ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2011 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+
18+//======================================================================
19+// include
20+#include "web/nacl/core/NaclModule.h"
21+#include "web/nacl/core/NaclError.h"
22+#include "web/nacl/debug/NaclDebug.h"
23+#include "web/nacl/object/NaclScriptableObj.h"
24+#include "web/nacl/object/NaclMethod.h"
25+#include "iris_using.h"
26+#include <algorithm>
27+
28+namespace test
29+{
30+
31+class TestInputHandler : public IInputHandler
32+{
33+public:
34+ virtual bool OnMouseEvent(const pp::MouseInputEvent& rEvent, PP_InputEvent_Type type)
35+ {
36+ OutputDebugVar(rEvent.GetPosition().x());
37+ OutputDebugVar(rEvent.GetPosition().y());
38+ return IInputHandler::OnMouseEvent(rEvent, type);
39+ }
40+ virtual bool OnKeyboardEvent(const pp::KeyboardInputEvent& rEvent, PP_InputEvent_Type type)
41+ {
42+ OutputDebugVar(rEvent.GetKeyCode());
43+ return IInputHandler::OnKeyboardEvent(rEvent, type);
44+ }
45+};
46+
47+class TestInstance : public CInstance<TestInstance>
48+{
49+ typedef CInstance<TestInstance> _Mybase;
50+ TestInputHandler m_Input;
51+public:
52+ explicit TestInstance(PP_Instance instance)
53+ : _Mybase(instance)
54+ {
55+ printf("Initialize TestScriptableObject.\n");
56+ RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL);
57+ RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
58+ SetInputHandler(&m_Input);
59+ }
60+};
61+
62+}
63+
64+// エントリポイントの記述
65+typedef CModule<test::TestInstance> Module;
66+static CModuleEntry<Module> s_module_entry;
67+
68+#if 1
69+namespace pp
70+{
71+
72+Module* CreateModule()
73+{
74+ if( IModuleEntry::GetInstancePtr() == nullptr ) return nullptr;
75+ return IModuleEntry::GetInstance().CreateInstance();
76+}
77+
78+}
79+#endif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--- trunk/framework/sample/Windows/unittest/src/nacl_test/input/index.txt (nonexistent)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/input/index.txt (revision 261)
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
--- trunk/framework/sample/Windows/unittest/src/nacl_test/input/scons.bat (nonexistent)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/input/scons.bat (revision 261)
@@ -0,0 +1,45 @@
1+
2+@echo off
3+
4+setlocal
5+
6+rem 環境変数の確認
7+if not defined NACL_SDK_ROOT (
8+ @echo NACL_SDK_ROOT を設定してください。
9+ goto error
10+)
11+
12+pushd "%~dp0"
13+SET PATH=c:\cygwin\bin;%PATH%
14+
15+SET CYG_NACL_SDK_ROOT=/cygdrive/%NACL_SDK_ROOT%
16+SET CYG_NACL_SDK_ROOT=%CYG_NACL_SDK_ROOT::=%
17+SET CYG_NACL_SDK_ROOT=%CYG_NACL_SDK_ROOT:\=/%
18+SET NACL_SDK_ROOT=%CYG_NACL_SDK_ROOT%
19+if not defined NACL_TARGET_PLATFORM SET NACL_TARGET_PLATFORM=pepper_15
20+SET NACL_SDK_PLATFORM_DIR=%NACL_SDK_ROOT%/%NACL_TARGET_PLATFORM%
21+
22+SET PYTHONPATH=%NACL_SDK_PLATFORM_DIR%/third_party/scons-2.0.1/engine
23+
24+SET PYTHON=python
25+%PYTHON% -O -OO "%NACL_SDK_PLATFORM_DIR%/third_party/scons-2.0.1/script/scons" ^
26+--warn no-visual-c-missing ^
27+--file=build.scons ^
28+--site-dir="%NACL_SDK_PLATFORM_DIR%/build_tools/nacl_sdk_scons" %*
29+
30+rem bash -c "python -O -OO \"%NACL_SDK_PLATFORM_DIR%/third_party/scons-2.0.1/script/scons\" ^
31+rem --warn no-visual-c-missing ^
32+rem --file=build.scons ^
33+rem --site-dir=\"%NACL_SDK_PLATFORM_DIR%/build_tools/nacl_sdk_scons\" %*"
34+
35+if errorlevel 1 goto error
36+
37+goto end
38+
39+:error
40+pause
41+exit /b 1
42+
43+:end
44+exit /b 0
45+
--- trunk/framework/sample/Windows/unittest/src/nacl_test/input/index.html (nonexistent)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/input/index.html (revision 261)
@@ -0,0 +1,121 @@
1+<!DOCTYPE html>
2+<html lang="ja">
3+
4+
5+
6+
7+
8+<head>
9+<title>test</title>
10+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
12+<script type="text/javascript">google.load("jquery", "1.5");</script>
13+
14+<script type="text/javascript">
15+ hModule = null; // Global application object.
16+ statusText = 'NO-STATUS';
17+ var kMaxArraySize = 20;
18+ var messageArray = new Array();
19+
20+ function $(id) {
21+ return document.getElementById(id);
22+ }
23+
24+ function moduleDidLoad() {
25+ hModule = document.getElementById('input');
26+ // Add a message handler that accepts messages coming from the NaCl
27+ // module.
28+ hModule.addEventListener('message', handleMessage, true);
29+ updateStatus('SUCCESS');
30+ }
31+
32+ // Handle a message coming from the NaCl module.
33+ function handleMessage(message) {
34+ // Show last |kMaxArraySize| events in html.
35+ messageArray.push(message.data);
36+ if (messageArray.length > kMaxArraySize) {
37+ messageArray.shift();
38+ }
39+ var newData = messageArray.join('<BR>');
40+ document.getElementById('eventString').innerHTML = newData;
41+ // Print event to console.
42+ console.log(message.data);
43+ }
44+
45+ // If the page loads before the Native Client module loads, then set the
46+ // status message indicating that the module is still loading. Otherwise,
47+ // do not change the status message.
48+ function pageDidLoad() {
49+ if (hModule == null) {
50+ updateStatus('LOADING...');
51+ } else {
52+ // It's possible that the Native Client module onload event fired
53+ // before the page's onload event. In this case, the status message
54+ // will reflect 'SUCCESS', but won't be displayed. This call will
55+ // display the current message.
56+ updateStatus();
57+ }
58+ }
59+
60+ // Set the global status message. If the element with id 'statusField'
61+ // exists, then set its HTML to the status message as well.
62+ // opt_message The message test. If this is null or undefined, then
63+ // attempt to set the element with id 'statusField' to the value of
64+ // |statusText|.
65+ function updateStatus(opt_message) {
66+ if (opt_message)
67+ statusText = opt_message;
68+ var statusField = document.getElementById('status_field');
69+ if (statusField) {
70+ statusField.innerHTML = statusText;
71+ }
72+ }
73+</script>
74+</head>
75+
76+<body onload="pageDidLoad()">
77+<!--[if lte IE 8]>
78+<p style="font-size : 20pt; padding : 1em ;">
79+IE では動作しません。
80+<a href="http://www.google.co.jp/chrome/intl/ja/landing_ie.html" target="_blank">Google Chrome</a> を利用してください。
81+</p>
82+<![endif]-->
83+<p>
84+ <!-- Load the published .nexe. This includes the 'src' attribute which
85+ shows how to load multi-architecture modules. Each entry in the "nexes"
86+ object in the .nmf manifest file is a key-value pair: the key is the runtime
87+ ('x86-32', 'x86-64', etc.); the value is a URL for the desired NaCl module.
88+ To load the debug versions of your .nexes, set the 'src' attribute to the
89+ _dbg.nmf version of the manifest file.
90+
91+ Note that the <EMBED> element is wrapped inside a <DIV>, which has a 'load'
92+ event listener attached. This method is used instead of attaching the 'load'
93+ event listener directly to the <EMBED> element to ensure that the listener
94+ is active before the NaCl module 'load' event fires.
95+ -->
96+ <div id="listener">
97+ <script type="text/javascript">
98+ function handleError(e) {
99+ var embed_element = document.getElementById('input');
100+ window.alert('Error: lastError = ' + embed_element.lastError);
101+ }
102+ $('listener').addEventListener('error', handleError, true);
103+ $('listener').addEventListener('load', moduleDidLoad, true);
104+ </script>
105+
106+ <embed name="nacl_module"
107+ id="input"
108+ width=400 height=400
109+ src="input.nmf"
110+ type="application/x-nacl"
111+ style="background-color:gray" />
112+ </div>
113+</p>
114+<h2>Events</h2>
115+<p><b id='eventString'>None</b></p>
116+
117+
118+<h2>Status</h2>
119+<div id="status_field">NO-STATUS</div>
120+</body>
121+</html>
--- trunk/framework/sample/Windows/unittest/src/nacl_test/index.html (revision 260)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/index.html (revision 261)
@@ -29,6 +29,7 @@
2929 </dd>
3030 <dt><a href="hash/hash.html">Hash</a></dt>
3131 <dt><a href="prime/prime.html">is prime number</a></dt>
32+ <dt><a href="input/index.html">input</a></dt>
3233 <dt><a href="test/test.html">test</a></dt>
3334 </dl>
3435 </body>
--- trunk/framework/src/platform/windows/win/os/modules/WXMDbgHelp.h (revision 260)
+++ trunk/framework/src/platform/windows/win/os/modules/WXMDbgHelp.h (revision 261)
@@ -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 */
@@ -21,6 +21,10 @@
2121 // include
2222 #include "../WXModule.h"
2323
24+#if !defined(_IMAGEHLP_)
25+# include <dbghelp.h>
26+#endif
27+
2428 namespace iris {
2529 namespace wx
2630 {
@@ -33,6 +37,25 @@
3337 class CDbgHelpModule : private INonCopyable<CDbgHelpModule>
3438 {
3539 CModule m_Module;
40+#if defined(_IMAGEHLP64)
41+ typedef DWORD64 XDWORD;
42+ typedef PDWORD64 PXDWORD;
43+ typedef ULONG64 XULONG;
44+ typedef PIMAGEHLP_LINE64 PXIMAGEHLP_LINE;
45+ typedef PIMAGEHLP_SYMBOL64 PXIMAGEHLP_SYMBOL;
46+ typedef PSYM_ENUMSYMBOLS_CALLBACK64 PXSYM_ENUMSYMBOLS_CALLBACK;
47+ typedef PSYM_ENUMSYMBOLS_CALLBACK64W PXSYM_ENUMSYMBOLS_CALLBACKW;
48+ typedef PSYM_ENUMMODULES_CALLBACK64 PXSYM_ENUMMODULES_CALLBACK;
49+#else
50+ typedef DWORD XDWORD;
51+ typedef PDWORD PXDWORD;
52+ typedef ULONG XULONG;
53+ typedef PIMAGEHLP_LINE PXIMAGEHLP_LINE;
54+ typedef PIMAGEHLP_SYMBOL PXIMAGEHLP_SYMBOL;
55+ typedef PSYM_ENUMSYMBOLS_CALLBACK PXSYM_ENUMSYMBOLS_CALLBACK;
56+ typedef PSYM_ENUMSYMBOLS_CALLBACKW PXSYM_ENUMSYMBOLS_CALLBACKW;
57+ typedef PSYM_ENUMMODULES_CALLBACK PXSYM_ENUMMODULES_CALLBACK;
58+#endif
3659 private:
3760 // コンストラクタ
3861 CDbgHelpModule(void) { Load(); }
@@ -66,6 +89,190 @@
6689 * @name wrap
6790 * @{
6891 */
92+ static BOOL SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
93+ {
94+ PROC_LOAD(BOOL, SymInitialize, (HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess), FALSE);
95+ return pfnProc(hProcess, UserSearchPath, fInvadeProcess);
96+ }
97+ static BOOL SymCleanup(HANDLE hProcess)
98+ {
99+ PROC_LOAD(BOOL, SymCleanup, (HANDLE hProcess), FALSE);
100+ return pfnProc(hProcess);
101+ }
102+ static DWORD SymLoadModule(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, XDWORD BaseOfDll, DWORD SizeOfDll)
103+ {
104+#if defined(_IMAGEHLP64)
105+ PROC_LOAD(DWORD, SymLoadModule64, (HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, XDWORD BaseOfDll, DWORD SizeOfDll), 0);
106+#else
107+ PROC_LOAD(DWORD, SymLoadModule, (HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, XDWORD BaseOfDll, DWORD SizeOfDll), 0);
108+#endif
109+ return pfnProc(hProcess, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
110+ }
111+ static BOOL SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll)
112+ {
113+ PROC_LOAD(BOOL, SymUnloadModule, (HANDLE hProcess, DWORD BaseOfDll), FALSE);
114+ return pfnProc(hProcess, BaseOfDll);
115+ }
116+ static BOOL SymSetSearchPath(HANDLE hProcess, PCSTR SearchPath)
117+ {
118+ PROC_LOAD(BOOL, SymSetSearchPath, (HANDLE hProcess, PCSTR SearchPath), FALSE);
119+ return pfnProc(hProcess, SearchPath);
120+ }
121+ static BOOL SymGetSearchPath(HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength)
122+ {
123+ PROC_LOAD(BOOL, SymGetSearchPath, (HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength), FALSE);
124+ return pfnProc(hProcess, SearchPath, SearchPathLength);
125+ }
126+ static BOOL SymRegisterCallback(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext)
127+ {
128+ PROC_LOAD(BOOL, SymRegisterCallback, (HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext), FALSE);
129+ return pfnProc(hProcess, CallbackFunction, UserContext);
130+ }
131+ static BOOL SymRegisterFunctionEntryCallback(HANDLE hProcess, PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction, PVOID UserContext)
132+ {
133+ PROC_LOAD(BOOL, SymRegisterFunctionEntryCallback, (HANDLE hProcess, PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction, PVOID UserContext), FALSE);
134+ return pfnProc(hProcess, CallbackFunction, UserContext);
135+ }
136+ static DWORD SymSetOptions(DWORD SymOptions)
137+ {
138+ PROC_LOAD(DWORD, SymSetOptions, (DWORD SymOptions), 0);
139+ return pfnProc(SymOptions);
140+ }
141+ static DWORD SymGetOptions(void)
142+ {
143+ PROC_LOAD(DWORD, SymGetOptions, (), 0);
144+ return pfnProc();
145+ }
146+ static BOOL SymGetSymPrev(HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol)
147+ {
148+#if defined(_IMAGEHLP64)
149+ PROC_LOAD(BOOL, SymGetSymPrev64, (HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol), FALSE);
150+#else
151+ PROC_LOAD(BOOL, SymGetSymPrev, (HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol), FALSE);
152+#endif
153+ return pfnProc(hProcess, Symbol);
154+ }
155+ static BOOL SymGetSymNext(HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol)
156+ {
157+#if defined(_IMAGEHLP64)
158+ PROC_LOAD(BOOL, SymGetSymNext64, (HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol), FALSE);
159+#else
160+ PROC_LOAD(BOOL, SymGetSymNext, (HANDLE hProcess, PXIMAGEHLP_SYMBOL Symbol), FALSE);
161+#endif
162+ return pfnProc(hProcess, Symbol);
163+ }
164+ static BOOL SymGetSymFromName(HANDLE hProcess, PCSTR Name, PXIMAGEHLP_SYMBOL Symbol)
165+ {
166+#if defined(_IMAGEHLP64)
167+ PROC_LOAD(BOOL, SymGetSymFromName64, (HANDLE hProcess, PCSTR Name, PXIMAGEHLP_SYMBOL Symbol), FALSE);
168+#else
169+ PROC_LOAD(BOOL, SymGetSymFromName, (HANDLE hProcess, PCSTR Name, PXIMAGEHLP_SYMBOL Symbol), FALSE);
170+#endif
171+ return pfnProc(hProcess, Name, Symbol);
172+ }
173+ static BOOL SymGetSymFromAddr(HANDLE hProcess, XDWORD dwAddr, PXDWORD pdwDisplacement, PXIMAGEHLP_SYMBOL Symbol)
174+ {
175+#if defined(_IMAGEHLP64)
176+ PROC_LOAD(BOOL, SymGetSymFromAddr64, (HANDLE hProcess, XDWORD dwAddr, PXDWORD pdwDisplacement, PXIMAGEHLP_SYMBOL Symbol), FALSE);
177+#else
178+ PROC_LOAD(BOOL, SymGetSymFromAddr, (HANDLE hProcess, XDWORD dwAddr, PXDWORD pdwDisplacement, PXIMAGEHLP_SYMBOL Symbol), FALSE);
179+#endif
180+ return pfnProc(hProcess, dwAddr, pdwDisplacement, Symbol);
181+ }
182+ static BOOL SymGetLinePrev(HANDLE hProcess, PXIMAGEHLP_LINE Line)
183+ {
184+#if defined(_IMAGEHLP64)
185+ PROC_LOAD(BOOL, SymGetLinePrev64, (HANDLE hProcess, PXIMAGEHLP_LINE Line), FALSE);
186+#else
187+ PROC_LOAD(BOOL, SymGetLinePrev, (HANDLE hProcess, PXIMAGEHLP_LINE Line), FALSE);
188+#endif
189+ return pfnProc(hProcess, Line);
190+ }
191+ static BOOL SymGetLineNext(HANDLE hProcess, PXIMAGEHLP_LINE Line)
192+ {
193+#if defined(_IMAGEHLP64)
194+ PROC_LOAD(BOOL, SymGetLineNext64, (HANDLE hProcess, PXIMAGEHLP_LINE Line), FALSE);
195+#else
196+ PROC_LOAD(BOOL, SymGetLineNext, (HANDLE hProcess, PXIMAGEHLP_LINE Line), FALSE);
197+#endif
198+ return pfnProc(hProcess, Line);
199+ }
200+ static BOOL SymGetLineFromName(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PXIMAGEHLP_LINE Line)
201+ {
202+#if defined(_IMAGEHLP64)
203+ PROC_LOAD(BOOL, SymGetLineFromName64, (HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PXIMAGEHLP_LINE Line), FALSE);
204+#else
205+ PROC_LOAD(BOOL, SymGetLineFromName, (HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PXIMAGEHLP_LINE Line), FALSE);
206+#endif
207+ return pfnProc(hProcess, ModuleName, FileName, dwLineNumber, plDisplacement, Line);
208+ }
209+ static BOOL SymGetLineFromAddr(HANDLE hProcess, XDWORD dwAddr, PDWORD pdwDisplacement, PXIMAGEHLP_LINE Line)
210+ {
211+#if defined(_IMAGEHLP64)
212+ PROC_LOAD(BOOL, SymGetLineFromAddr64, (HANDLE hProcess, XDWORD dwAddr, PDWORD pdwDisplacement, PXIMAGEHLP_LINE Line), FALSE);
213+#else
214+ PROC_LOAD(BOOL, SymGetLineFromAddr, (HANDLE hProcess, XDWORD dwAddr, PDWORD pdwDisplacement, PXIMAGEHLP_LINE Line), FALSE);
215+#endif
216+ return pfnProc(hProcess, dwAddr, pdwDisplacement, Line);
217+ }
218+ static BOOL SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo)
219+ {
220+ PROC_LOAD(BOOL, SymGetModuleInfo, (HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo), FALSE);
221+ return pfnProc(hProcess, dwAddr, ModuleInfo);
222+ }
223+ static PGET_MODULE_BASE_ROUTINE GetSymGetModuleBaseProc(void)
224+ {
225+#if defined(_IMAGEHLP64)
226+ PROC_LOAD(DWORD, SymGetModuleBase64, (HANDLE hProcess, XDWORD dwAddr), 0);
227+#else
228+ PROC_LOAD(DWORD, SymGetModuleBase, (HANDLE hProcess, XDWORD dwAddr), 0);
229+#endif
230+ return pfnProc;
231+ }
232+ static DWORD SymGetModuleBase(HANDLE hProcess, XDWORD dwAddr)
233+ {
234+ return GetSymGetModuleBaseProc()(hProcess, dwAddr);
235+ }
236+ static PFUNCTION_TABLE_ACCESS_ROUTINE GetSymFunctionTableAccessProc(void)
237+ {
238+#if defined(_IMAGEHLP64)
239+ PROC_LOAD(PVOID, SymFunctionTableAccess64, (HANDLE hProcess, XDWORD AddrBase), NULL);
240+#else
241+ PROC_LOAD(PVOID, SymFunctionTableAccess, (HANDLE hProcess, XDWORD AddrBase), NULL);
242+#endif
243+ return pfnProc;
244+ }
245+ static PVOID SymFunctionTableAccess(HANDLE hProcess, XDWORD AddrBase)
246+ {
247+ return GetSymFunctionTableAccessProc()(hProcess, AddrBase);
248+ }
249+ static BOOL SymEnumerateSymbols(HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
250+ {
251+#if defined(_IMAGEHLP64)
252+ PROC_LOAD(BOOL, SymEnumerateSymbols64, (HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext), FALSE);
253+#else
254+ PROC_LOAD(BOOL, SymEnumerateSymbols, (HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext), FALSE);
255+#endif
256+ return pfnProc(hProcess, BaseOfDll, EnumSymbolsCallback, UserContext);
257+ }
258+ static BOOL SymEnumerateSymbolsW(HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACKW EnumSymbolsCallback, PVOID UserContext)
259+ {
260+#if defined(_IMAGEHLP64)
261+ PROC_LOAD(BOOL, SymEnumerateSymbolsW64, (HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACKW EnumSymbolsCallback, PVOID UserContext), FALSE);
262+#else
263+ PROC_LOAD(BOOL, SymEnumerateSymbolsW, (HANDLE hProcess, XULONG BaseOfDll, PXSYM_ENUMSYMBOLS_CALLBACKW EnumSymbolsCallback, PVOID UserContext), FALSE);
264+#endif
265+ return pfnProc(hProcess, BaseOfDll, EnumSymbolsCallback, UserContext);
266+ }
267+ static BOOL SymEnumerateModules(HANDLE hProcess, PXSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext)
268+ {
269+#if defined(_IMAGEHLP64)
270+ PROC_LOAD(BOOL, SymEnumerateSymbols64, (HANDLE hProcess, PXSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext), FALSE);
271+#else
272+ PROC_LOAD(BOOL, SymEnumerateSymbols, (HANDLE hProcess, PXSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext), FALSE);
273+#endif
274+ return pfnProc(hProcess, EnumModulesCallback, UserContext);
275+ }
69276 static BOOL StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, PVOID ContextRecord
70277 , PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
71278 , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
@@ -72,10 +279,16 @@
72279 {
73280 PROC_LOAD(BOOL, StackWalk, (DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, PVOID ContextRecord
74281 , PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
75- , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress), FALSE);
282+ , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
283+ , FALSE);
76284 return pfnProc(MachineType, hProcess, hThread, StackFrame, ContextRecord
77285 , ReadMemoryRoutine, FunctionTableAccessRoutine, GetModuleBaseRoutine, TranslateAddress);
78286 }
287+ static PVOID ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size)
288+ {
289+ PROC_LOAD(PVOID, ImageDirectoryEntryToData, (PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size), NULL);
290+ return pfnProc(Base, MappedAsImage, DirectoryEntry, Size);
291+ }
79292 /**
80293 * @}
81294 */
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXDirectoryEntry.h (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXDirectoryEntry.h (nonexistent)
@@ -1,84 +0,0 @@
1-//======================================================================
2-//-----------------------------------------------------------------------
3-/**
4- * @file WXDirectoryEntry.h
5- * @brief DIRECTORY ENTRY ファイル
6- *
7- * @author t.sirayanagi
8- * @version 1.0
9- *
10- * @par copyright
11- * Copyright (C) 2010-2011 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_WXDirectoryEntry_H_
18-#define INCG_IRIS_WXDirectoryEntry_H_
19-
20-//======================================================================
21-// include
22-#include "../../../../../iris_object.h"
23-#include "WXDebugHelp.h"
24-
25-#if defined(IRIS_WIN32_WCE)
26-#error not support.
27-#endif
28-
29-namespace iris {
30-namespace wx
31-{
32-
33-//======================================================================
34-// class
35-template<USHORT DirectoryEntry>
36-class CDirectoryEntry : public IIrisObject
37-{
38- template<USHORT DE>struct type_impl { typedef VOID value_type; };
39- template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_IMPORT> { typedef IMAGE_IMPORT_DESCRIPTOR value_type; };
40- template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_EXPORT> { typedef IMAGE_EXPORT_DIRECTORY value_type; };
41-
42-public:
43- typedef typename type_impl<DirectoryEntry>::value_type value_type;
44- typedef value_type *value_ptr;
45- typedef value_type &value_ref;
46-
47-public:
48- value_ptr m_pEntry; //!< エントリー
49- ULONG m_nSize; //!< サイズ
50-
51-public:
52- /// コンストラクタ
53- CDirectoryEntry(PVOID pBase, BOOLEAN bMappedAsImage)
54- : m_pEntry(nullptr)
55- , m_nSize(0)
56- {
57- m_pEntry = ToData(pBase, bMappedAsImage, &m_nSize);
58- }
59-
60-public:
61- value_ref operator * (void) { return *m_pEntry; }
62- value_ptr operator -> (void) { return m_pEntry; }
63- value_ptr ptr(void) { return m_pEntry; }
64-
65- operator value_ptr (void) { return m_pEntry; }
66-
67-public:
68- /// データ取得
69- static value_ptr ToData(PVOID pBase, BOOLEAN bMappedAsImage, PULONG pSize)
70- {
71- return static_cast<value_ptr>(ImageDirectoryEntryToData(pBase, bMappedAsImage, DirectoryEntry, pSize));
72- }
73- /// データ取得
74- static value_ptr ToData(PVOID pBase, BOOLEAN bMappedAsImage)
75- {
76- ULONG uSize = 0;
77- return ToData(pBase, bMappedAsImage, &uSize);
78- }
79-};
80-
81-} // end of namespace wx
82-} // end of namespace iris
83-
84-#endif
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXDebugHelp.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXDebugHelp.cpp (nonexistent)
@@ -1,336 +0,0 @@
1-//======================================================================
2-//-----------------------------------------------------------------------
3-/**
4- * @file WXDebugHelp.cpp
5- * @brief dbghelp ファイル
6- *
7- * @author t.sirayanagi
8- * @version 1.0
9- *
10- * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
12- * The new BSD License is applied to this software.
13- * see iris_LICENSE.txt
14-*/
15-//-----------------------------------------------------------------------
16-//======================================================================
17-#define INCG_IRIS_WXDebugHelp_CPP_
18-
19-//======================================================================
20-// include
21-#include "WXDebugHelp.h"
22-#include "../../os/WXModule.h"
23-
24-#if 1
25-//======================================================================
26-// link
27-#pragma comment(lib, "dbghelp.lib")
28-
29-#else
30-
31-namespace iris {
32-namespace wx {
33-namespace dbg
34-{
35-
36-//======================================================================
37-// declare
38-class CDbgHelp;
39-
40-//======================================================================
41-// static
42-namespace {
43-static CDbgHelp* s_pDbgHelp = nullptr;
44-}
45-
46-//======================================================================
47-// class
48-// dbghelp クラス
49-class CDbgHelp : public IIrisObject
50-{
51- CModule m_Module;
52-public:
53- // コンストラクタ
54- CDbgHelp(void)
55- {
56- s_pDbgHelp = this;
57- }
58- // デストラクタ
59- ~CDbgHelp(void)
60- {
61- s_pDbgHelp = nullptr;
62- }
63-
64-public:
65- // インスタンスの取得
66- static CDbgHelp& GetInstance(void) { static CDbgHelp instance; return instance; }
67- static CDbgHelp* GetInstancePtr(void) { CDbgHelp& instance = GetInstance(); return s_pDbgHelp; }
68-
69-public:
70- // ロード
71- bool Load(void)
72- {
73- if( m_Module.IsValid() ) return true;
74- return IRIS_TO_bool( m_Module.Load(TEXT("dbghelp.dll")) );
75- }
76-
77-public:
78-#define PROC_LOAD(_ret, _name, _args, _err) \
79- typedef _ret (__stdcall *pfn##_name)##_args; \
80- static pfn##_name pfnProc = nullptr; \
81- do { \
82- if( pfnProc == nullptr ) { \
83- Load(); \
84- pfnProc = pointer_cast<pfn##_name>(m_Module.GetProcAddress(#_name)); \
85- if( pfnProc == nullptr ) return _err; \
86- } } while(0)
87-
88- BOOL SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
89- {
90- PROC_LOAD(BOOL, SymInitialize, (HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess), FALSE);
91- return pfnProc(hProcess, UserSearchPath, fInvadeProcess);
92- }
93- BOOL SymCleanup(HANDLE hProcess)
94- {
95- PROC_LOAD(BOOL, SymCleanup, (HANDLE hProcess), FALSE);
96- return pfnProc(hProcess);
97- }
98- DWORD SymLoadModule(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
99- {
100- PROC_LOAD(DWORD, SymLoadModule, (HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll), 0);
101- return pfnProc(hProcess, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
102- }
103- BOOL SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll)
104- {
105- PROC_LOAD(BOOL, SymUnloadModule, (HANDLE hProcess, DWORD BaseOfDll), FALSE);
106- return pfnProc(hProcess, BaseOfDll);
107- }
108- BOOL SymSetSearchPath(HANDLE hProcess, PCSTR SearchPath)
109- {
110- PROC_LOAD(BOOL, SymSetSearchPath, (HANDLE hProcess, PCSTR SearchPath), FALSE);
111- return pfnProc(hProcess, SearchPath);
112- }
113- BOOL SymGetSearchPath(HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength)
114- {
115- PROC_LOAD(BOOL, SymGetSearchPath, (HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength), FALSE);
116- return pfnProc(hProcess, SearchPath, SearchPathLength);
117- }
118- BOOL SymRegisterCallback(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext)
119- {
120- PROC_LOAD(BOOL, SymRegisterCallback, (HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext), FALSE);
121- return pfnProc(hProcess, CallbackFunction, UserContext);
122- }
123- BOOL SymRegisterFunctionEntryCallback(HANDLE hProcess, PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction, PVOID UserContext)
124- {
125- PROC_LOAD(BOOL, SymRegisterFunctionEntryCallback, (HANDLE hProcess, PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction, PVOID UserContext), FALSE);
126- return pfnProc(hProcess, CallbackFunction, UserContext);
127- }
128- DWORD SymSetOptions(DWORD SymOptions)
129- {
130- PROC_LOAD(DWORD, SymSetOptions, (DWORD SymOptions), 0);
131- return pfnProc(SymOptions);
132- }
133- DWORD SymGetOptions(void)
134- {
135- PROC_LOAD(DWORD, SymGetOptions, (), 0);
136- return pfnProc();
137- }
138- BOOL SymGetSymPrev(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
139- {
140- PROC_LOAD(BOOL, SymGetSymPrev, (HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol), FALSE);
141- return pfnProc(hProcess, Symbol);
142- }
143- BOOL SymGetSymNext(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
144- {
145- PROC_LOAD(BOOL, SymGetSymNext, (HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol), FALSE);
146- return pfnProc(hProcess, Symbol);
147- }
148- BOOL SymGetSymFromName(HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symbol)
149- {
150- PROC_LOAD(BOOL, SymGetSymFromName, (HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symbol), FALSE);
151- return pfnProc(hProcess, Name, Symbol);
152- }
153- BOOL SymGetSymFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL Symbol)
154- {
155- PROC_LOAD(BOOL, SymGetSymFromAddr, (HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL Symbol), FALSE);
156- return pfnProc(hProcess, dwAddr, pdwDisplacement, Symbol);
157- }
158- BOOL SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line)
159- {
160- PROC_LOAD(BOOL, SymGetLinePrev, (HANDLE hProcess, PIMAGEHLP_LINE Line), FALSE);
161- return pfnProc(hProcess, Line);
162- }
163- BOOL SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line)
164- {
165- PROC_LOAD(BOOL, SymGetLineNext, (HANDLE hProcess, PIMAGEHLP_LINE Line), FALSE);
166- return pfnProc(hProcess, Line);
167- }
168- BOOL SymGetLineFromName(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PIMAGEHLP_LINE Line)
169- {
170- PROC_LOAD(BOOL, SymGetLineFromName, (HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PIMAGEHLP_LINE Line), FALSE);
171- return pfnProc(hProcess, ModuleName, FileName, dwLineNumber, plDisplacement, Line);
172- }
173- BOOL SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line)
174- {
175- PROC_LOAD(BOOL, SymGetLineFromAddr, (HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line), FALSE);
176- return pfnProc(hProcess, dwAddr, pdwDisplacement, Line);
177- }
178- BOOL SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo)
179- {
180- PROC_LOAD(BOOL, SymGetModuleInfo, (HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo), FALSE);
181- return pfnProc(hProcess, dwAddr, ModuleInfo);
182- }
183- DWORD SymGetModuleBase(HANDLE hProcess, DWORD dwAddr)
184- {
185- PROC_LOAD(DWORD, SymGetModuleBase, (HANDLE hProcess, DWORD dwAddr), 0);
186- return pfnProc(hProcess, dwAddr);
187- }
188- PVOID SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
189- {
190- PROC_LOAD(PVOID, SymFunctionTableAccess, (HANDLE hProcess, DWORD AddrBase), NULL);
191- return pfnProc(hProcess, AddrBase);
192- }
193- BOOL SymEnumerateSymbols(HANDLE hProcess, ULONG BaseOfDll, PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
194- {
195- PROC_LOAD(BOOL, SymEnumerateSymbols, (HANDLE hProcess, ULONG BaseOfDll, PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext), FALSE);
196- return pfnProc(hProcess, BaseOfDll, EnumSymbolsCallback, UserContext);
197- }
198- BOOL SymEnumerateModules(HANDLE hProcess, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext)
199- {
200- PROC_LOAD(BOOL, SymEnumerateSymbols, (HANDLE hProcess, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext), FALSE);
201- return pfnProc(hProcess, EnumModulesCallback, UserContext);
202- }
203- BOOL StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, PVOID ContextRecord
204- , PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
205- , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
206- {
207- PROC_LOAD(BOOL, StackWalk, (DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, PVOID ContextRecord
208- , PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
209- , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
210- , FALSE);
211- return pfnProc(MachineType, hProcess, hThread, StackFrame, ContextRecord
212- , ReadMemoryRoutine, FunctionTableAccessRoutine, GetModuleBaseRoutine, TranslateAddress);
213- }
214- PVOID ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size)
215- {
216- PROC_LOAD(PVOID, ImageDirectoryEntryToData, (PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size), NULL);
217- return pfnProc(Base, MappedAsImage, DirectoryEntry, Size);
218- }
219-};
220-
221-} // end of namespace dbg
222-} // end of namespace wx
223-} // end of namespace iris
224-
225-using namespace iris;
226-using namespace wx;
227-using namespace dbg;
228-
229-//======================================================================
230-// import
231-BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
232-{
233- return CDbgHelp::GetInstance().SymInitialize(hProcess, UserSearchPath, fInvadeProcess);
234-}
235-BOOL WINAPI SymCleanup(HANDLE hProcess)
236-{
237- if( CDbgHelp::GetInstancePtr() == nullptr ) return FALSE;
238- return CDbgHelp::GetInstance().SymCleanup(hProcess);
239-}
240-DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
241-{
242- return CDbgHelp::GetInstance().SymLoadModule(hProcess, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
243-}
244-BOOL WINAPI SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll)
245-{
246- return CDbgHelp::GetInstance().SymUnloadModule(hProcess, BaseOfDll);
247-}
248-BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PCSTR SearchPath)
249-{
250- return CDbgHelp::GetInstance().SymSetSearchPath(hProcess, SearchPath);
251-}
252-BOOL WINAPI SymGetSearchPath(HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength)
253-{
254- return CDbgHelp::GetInstance().SymGetSearchPath(hProcess, SearchPath, SearchPathLength);
255-}
256-BOOL WINAPI SymRegisterCallback(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext)
257-{
258- return CDbgHelp::GetInstance().SymRegisterCallback(hProcess, CallbackFunction, UserContext);
259-}
260-BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE hProcess, PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction, PVOID UserContext)
261-{
262- return CDbgHelp::GetInstance().SymRegisterFunctionEntryCallback(hProcess, CallbackFunction, UserContext);
263-}
264-DWORD WINAPI SymSetOptions(DWORD SymOptions)
265-{
266- return CDbgHelp::GetInstance().SymSetOptions(SymOptions);
267-}
268-DWORD WINAPI SymGetOptions(void)
269-{
270- return CDbgHelp::GetInstance().SymGetOptions();
271-}
272-BOOL WINAPI SymGetSymPrev(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
273-{
274- return CDbgHelp::GetInstance().SymGetSymPrev(hProcess, Symbol);
275-}
276-BOOL WINAPI SymGetSymNext(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
277-{
278- return CDbgHelp::GetInstance().SymGetSymNext(hProcess, Symbol);
279-}
280-BOOL WINAPI SymGetSymFromName(HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symbol)
281-{
282- return CDbgHelp::GetInstance().SymGetSymFromName(hProcess, Name, Symbol);
283-}
284-BOOL WINAPI SymGetSymFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL Symbol)
285-{
286- return CDbgHelp::GetInstance().SymGetSymFromAddr(hProcess, dwAddr, pdwDisplacement, Symbol);
287-}
288-BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line)
289-{
290- return CDbgHelp::GetInstance().SymGetLinePrev(hProcess, Line);
291-}
292-BOOL WINAPI SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line)
293-{
294- return CDbgHelp::GetInstance().SymGetLineNext(hProcess, Line);
295-}
296-BOOL WINAPI SymGetLineFromName(HANDLE hProcess, PCSTR ModuleName, PCSTR FileName, DWORD dwLineNumber, PLONG plDisplacement, PIMAGEHLP_LINE Line)
297-{
298- return CDbgHelp::GetInstance().SymGetLineFromName(hProcess, ModuleName, FileName, dwLineNumber, plDisplacement, Line);
299-}
300-BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line)
301-{
302- return CDbgHelp::GetInstance().SymGetLineFromAddr(hProcess, dwAddr, pdwDisplacement, Line);
303-}
304-BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo)
305-{
306- return CDbgHelp::GetInstance().SymGetModuleInfo(hProcess, dwAddr, ModuleInfo);
307-}
308-DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr)
309-{
310- return CDbgHelp::GetInstance().SymGetModuleBase(hProcess, dwAddr);
311-}
312-PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
313-{
314- return CDbgHelp::GetInstance().SymFunctionTableAccess(hProcess, AddrBase);
315-}
316-BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, ULONG BaseOfDll, PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
317-{
318- return CDbgHelp::GetInstance().SymEnumerateSymbols(hProcess, BaseOfDll, EnumSymbolsCallback, UserContext);
319-}
320-BOOL WINAPI SymEnumerateModules(HANDLE hProcess, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext)
321-{
322- return CDbgHelp::GetInstance().SymEnumerateModules(hProcess, EnumModulesCallback, UserContext);
323-}
324-BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME StackFrame, PVOID ContextRecord
325- , PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
326- , PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
327-{
328- return CDbgHelp::GetInstance().StackWalk(MachineType, hProcess, hThread, StackFrame, ContextRecord
329- , ReadMemoryRoutine, FunctionTableAccessRoutine, GetModuleBaseRoutine, TranslateAddress);
330-}
331-PVOID WINAPI ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size)
332-{
333- return CDbgHelp::GetInstance().ImageDirectoryEntryToData(Base, MappedAsImage, DirectoryEntry, Size);
334-}
335-
336-#endif
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXProcHook.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXProcHook.cpp (revision 261)
@@ -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 */
@@ -19,6 +19,7 @@
1919 //======================================================================
2020 // include
2121 #include "WXProcHook.h"
22+#include "WXImageDirectoryEntry.h"
2223 #include "WXDebugHelp.h"
2324
2425 namespace iris {
@@ -66,9 +67,7 @@
6667 {
6768 Close();
6869
69- ULONG ulSize;
70- PIMAGE_IMPORT_DESCRIPTOR pidesc = static_cast<PIMAGE_IMPORT_DESCRIPTOR>(ImageDirectoryEntryToData(
71- hModule, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &ulSize));
70+ CImageDirectoryEntry<IMAGE_DIRECTORY_ENTRY_IMPORT> pidesc((PVOID)hModule, TRUE);
7271 if( pidesc == nullptr ) return false;
7372
7473 while( pidesc->Name )
@@ -145,7 +144,7 @@
145144 {
146145 if( !IsOpen() ) return false;
147146 DWORD dwOldProtect;
148- PROC* ppfn = reinterpret_cast<PROC*>(&m_pThunk->u1.Function);
147+ PROC* ppfn = pointer_cast<PROC*>(&m_pThunk->u1.Function);
149148 m_pfnPrev = *ppfn;
150149 VirtualProtect(ppfn, sizeof(ppfn), PAGE_EXECUTE_READWRITE, &dwOldProtect);
151150 WriteProcessMemory(GetCurrentProcess(), ppfn, &pfnNew, sizeof(pfnNew), nullptr);
@@ -198,7 +197,6 @@
198197 //======================================================================
199198 // include
200199 #include "unit/gt/gt_inchead.h"
201-#include "../../os/WXModule.h"
202200 #include "iris_using.h"
203201
204202 static int WINAPI _User_MessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackTrace.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackTrace.cpp (revision 261)
@@ -125,7 +125,7 @@
125125 bool ret = false;
126126 while(count)
127127 {
128- if( !walker.Walk(nullptr, ::SymFunctionTableAccess, ::SymGetModuleBase, nullptr) )
128+ if( !walker.Walk(nullptr, CDbgHelpModule::GetSymFunctionTableAccessProc(), CDbgHelpModule::GetSymGetModuleBaseProc(), nullptr) )
129129 {
130130 break;
131131 }
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXDumpExceptionFilter.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXDumpExceptionFilter.cpp (revision 261)
@@ -143,7 +143,7 @@
143143
144144 while(1)
145145 {
146- if( !walker.Walk(nullptr, ::SymFunctionTableAccess, ::SymGetModuleBase, nullptr) )
146+ if( !walker.Walk(nullptr, CDbgHelpModule::GetSymFunctionTableAccessProc(), CDbgHelpModule::GetSymGetModuleBaseProc(), nullptr) )
147147 {
148148 break;
149149 }
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (nonexistent)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (revision 261)
@@ -0,0 +1,95 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file WXDirectoryEntry.h
5+ * @brief DIRECTORY ENTRY ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2010-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_WXDirectoryEntry_H_
18+#define INCG_IRIS_WXDirectoryEntry_H_
19+
20+//======================================================================
21+// include
22+#include "../../../../../iris_object.h"
23+#include "WXDebugHelp.h"
24+
25+#if defined(IRIS_WIN32_WCE)
26+#error not support.
27+#endif
28+
29+namespace iris {
30+namespace wx
31+{
32+
33+//======================================================================
34+// class
35+template<USHORT ENTRY>
36+class CImageDirectoryEntry : public IIrisObject
37+{
38+ typedef CImageDirectoryEntry<ENTRY> _Myt;
39+ template<USHORT DE>struct type_impl { typedef VOID value_type; };
40+ template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_IMPORT> { typedef IMAGE_IMPORT_DESCRIPTOR value_type; };
41+ template<>struct type_impl<IMAGE_DIRECTORY_ENTRY_EXPORT> { typedef IMAGE_EXPORT_DIRECTORY value_type; };
42+
43+public:
44+ typedef typename type_impl<ENTRY>::value_type value_type;
45+ typedef value_type *value_ptr;
46+ typedef value_type &value_ref;
47+
48+public:
49+ value_ptr m_pEntry; //!< エントリー
50+ ULONG m_nSize; //!< サイズ
51+
52+public:
53+ /// コンストラクタ
54+ CImageDirectoryEntry(PVOID pBase, BOOLEAN bMappedAsImage)
55+ : m_pEntry(nullptr)
56+ , m_nSize(0)
57+ {
58+ m_pEntry = ToData(pBase, bMappedAsImage, &m_nSize);
59+ }
60+
61+ CImageDirectoryEntry(const CImageDirectoryEntry& rhs)
62+ : m_pEntry(rhs.m_pEntry)
63+ , m_nSize(rhs.m_nSize)
64+ {
65+ }
66+
67+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; }
71+
72+ operator value_ptr (void) { return m_pEntry; }
73+
74+public:
75+ _Myt& operator ++ (void) { ++m_pEntry; return *this; }
76+ _Myt operator ++ (int) { _Myt tmp(*this); ++m_pEntry; return tmp; }
77+
78+public:
79+ /// データ取得
80+ static value_ptr ToData(PVOID pBase, BOOLEAN bMappedAsImage, PULONG pSize)
81+ {
82+ return static_cast<value_ptr>(CDbgHelpModule::ImageDirectoryEntryToData(pBase, bMappedAsImage, ENTRY, pSize));
83+ }
84+ /// データ取得
85+ static value_ptr ToData(PVOID pBase, BOOLEAN bMappedAsImage)
86+ {
87+ ULONG uSize = 0;
88+ return ToData(pBase, bMappedAsImage, &uSize);
89+ }
90+};
91+
92+} // end of namespace wx
93+} // end of namespace iris
94+
95+#endif
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXDbgModule.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXDbgModule.cpp (revision 261)
@@ -2,13 +2,13 @@
22 //-----------------------------------------------------------------------
33 /**
44 * @file WXDbgModule.cpp
5- * @brief WXDbgModule ファイル
5+ * @brief デバッグモジュール ファイル
66 *
77 * @author t.sirayanagi
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 */
@@ -20,7 +20,7 @@
2020 // include
2121 #include "WXDbgModule.h"
2222 #include "WXDebugHelp.h"
23-#include "WXDirectoryEntry.h"
23+#include "WXImageDirectoryEntry.h"
2424 #include "../../../../../iris_iostream.h"
2525
2626 namespace iris {
@@ -42,7 +42,7 @@
4242 HMODULE hModule = reinterpret_cast<HMODULE>(m_hObject);
4343 char** ppszFunctionName;
4444 WORD* pwFunctionOrdinal;
45- CDirectoryEntry<IMAGE_DIRECTORY_ENTRY_EXPORT> pImageExportDir((PVOID)hModule, TRUE);
45+ CImageDirectoryEntry<IMAGE_DIRECTORY_ENTRY_EXPORT> pImageExportDir((PVOID)hModule, TRUE);
4646 if(pImageExportDir == nullptr)
4747 {
4848 return false;
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXDebugHelp.h (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXDebugHelp.h (revision 261)
@@ -24,8 +24,6 @@
2424 #error not support.
2525 #endif
2626
27-#if !defined(_IMAGEHLP_)
28-# include <dbghelp.h>
29-#endif
27+#include "../../os/modules/WXMDbgHelp.h"
3028
3129 #endif
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXSymbol.cpp (revision 261)
@@ -72,7 +72,7 @@
7272 BOOL CSymbol::Initialize(HANDLE hProcess, PSTR UserSearchPath, BOOL bInvadeProcess)
7373 {
7474 if( !Attach(hProcess) ) return FALSE;
75- return ::SymInitialize(m_hObject, UserSearchPath, bInvadeProcess);
75+ return CDbgHelpModule::SymInitialize(m_hObject, UserSearchPath, bInvadeProcess);
7676 }
7777
7878 /**********************************************************************//**
@@ -86,7 +86,7 @@
8686 *//***********************************************************************/
8787 BOOL CSymbol::Initialize(PSTR UserSearchPath, BOOL bInvadeProcess)
8888 {
89- return ::SymInitialize(m_hObject, UserSearchPath, bInvadeProcess);
89+ return CDbgHelpModule::SymInitialize(m_hObject, UserSearchPath, bInvadeProcess);
9090 }
9191
9292 /**********************************************************************//**
@@ -98,7 +98,7 @@
9898 *//***********************************************************************/
9999 BOOL CSymbol::Cleanup(void)
100100 {
101- return ::SymCleanup(Detach());
101+ return CDbgHelpModule::SymCleanup(Detach());
102102 }
103103
104104 /**********************************************************************//**
@@ -115,7 +115,7 @@
115115 *//***********************************************************************/
116116 XDWORD CSymbol::LoadModule(HANDLE hFile, PSTR ImageName, PSTR ModuleName, XDWORD BaseOfDll, DWORD SizeOfDll)
117117 {
118- return ::SymLoadModule(m_hObject, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
118+ return CDbgHelpModule::SymLoadModule(m_hObject, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
119119 }
120120
121121 /**********************************************************************//**
@@ -128,7 +128,7 @@
128128 *//***********************************************************************/
129129 BOOL CSymbol::UnloadModule(DWORD BaseOfDll)
130130 {
131- return ::SymUnloadModule(m_hObject, BaseOfDll);
131+ return CDbgHelpModule::SymUnloadModule(m_hObject, BaseOfDll);
132132 }
133133
134134 /**********************************************************************//**
@@ -142,7 +142,7 @@
142142 *//***********************************************************************/
143143 BOOL CSymbol::EnumModules(PSYM_ENUMMODULES_CALLBACK pfnCallback, PVOID pUserData)
144144 {
145- return ::SymEnumerateModules(m_hObject, pfnCallback, pUserData);
145+ return CDbgHelpModule::SymEnumerateModules(m_hObject, pfnCallback, pUserData);
146146 }
147147
148148 /**********************************************************************//**
@@ -158,7 +158,7 @@
158158 BOOL CSymbol::EnumSymbols(XULONG BaseOfDll, PSYM_ENUMSYMBOLS_CALLBACK pfnCallback, PVOID pUserData)
159159 {
160160 IRIS_PRAGMA_WARNING_DISABLE(IRIS_MSC, 4996)
161- return ::SymEnumerateSymbols(m_hObject, BaseOfDll, pfnCallback, pUserData);
161+ return CDbgHelpModule::SymEnumerateSymbols(m_hObject, BaseOfDll, pfnCallback, pUserData);
162162 IRIS_PRAGMA_WARNING_DEFAULT(IRIS_MSC, 4996)
163163 };
164164
@@ -172,7 +172,7 @@
172172 *//***********************************************************************/
173173 LPVOID CSymbol::FunctionTableAccess(DWORD AddrBase)
174174 {
175- return ::SymFunctionTableAccess(m_hObject, AddrBase);
175+ return CDbgHelpModule::SymFunctionTableAccess(m_hObject, AddrBase);
176176 }
177177
178178 /**********************************************************************//**
@@ -187,7 +187,7 @@
187187 *//***********************************************************************/
188188 BOOL CSymbol::GetLineFromAddr(XDWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE pLine) const
189189 {
190- return ::SymGetLineFromAddr(m_hObject, dwAddr, pdwDisplacement, pLine);
190+ return CDbgHelpModule::SymGetLineFromAddr(m_hObject, dwAddr, pdwDisplacement, pLine);
191191 }
192192
193193 /**********************************************************************//**
@@ -205,7 +205,7 @@
205205 *//***********************************************************************/
206206 BOOL CSymbol::GetLineFromName(LPSTR ModuleName, LPSTR FileName, DWORD dwLineNumber, PLONG lpDisplacement, PIMAGEHLP_LINE pLine) const
207207 {
208- return ::SymGetLineFromName(m_hObject, ModuleName, FileName, dwLineNumber, lpDisplacement, pLine);
208+ return CDbgHelpModule::SymGetLineFromName(m_hObject, ModuleName, FileName, dwLineNumber, lpDisplacement, pLine);
209209 }
210210
211211 /**********************************************************************//**
@@ -218,7 +218,7 @@
218218 *//***********************************************************************/
219219 BOOL CSymbol::GetLineNext(PIMAGEHLP_LINE pLine) const
220220 {
221- return ::SymGetLineNext(m_hObject, pLine);
221+ return CDbgHelpModule::SymGetLineNext(m_hObject, pLine);
222222 }
223223
224224 /**********************************************************************//**
@@ -231,7 +231,7 @@
231231 *//***********************************************************************/
232232 BOOL CSymbol::GetLinePrev(PIMAGEHLP_LINE pLine) const
233233 {
234- return ::SymGetLinePrev(m_hObject, pLine);
234+ return CDbgHelpModule::SymGetLinePrev(m_hObject, pLine);
235235 }
236236
237237 /**********************************************************************//**
@@ -247,9 +247,9 @@
247247 BOOL CSymbol::GetSymFromAddr(XDWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL pSymbol) const
248248 {
249249 #if defined(_IMAGEHLP64)
250- return ::SymGetSymFromAddr(m_hObject, dwAddr, (PDWORD64)pdwDisplacement, pSymbol);
250+ return CDbgHelpModule::SymGetSymFromAddr(m_hObject, dwAddr, (PDWORD64)pdwDisplacement, pSymbol);
251251 #else
252- return ::SymGetSymFromAddr(m_hObject, dwAddr, pdwDisplacement, pSymbol);
252+ return CDbgHelpModule::SymGetSymFromAddr(m_hObject, dwAddr, pdwDisplacement, pSymbol);
253253 #endif
254254 }
255255
@@ -265,7 +265,7 @@
265265 *//***********************************************************************/
266266 BOOL CSymbol::GetSymFromName(LPSTR Name, PIMAGEHLP_SYMBOL pSymbol) const
267267 {
268- return ::SymGetSymFromName(m_hObject, Name, pSymbol);
268+ return CDbgHelpModule::SymGetSymFromName(m_hObject, Name, pSymbol);
269269 }
270270
271271 /**********************************************************************//**
@@ -278,7 +278,7 @@
278278 *//***********************************************************************/
279279 BOOL CSymbol::GetSymNext(PIMAGEHLP_SYMBOL pSymbol) const
280280 {
281- return ::SymGetSymNext(m_hObject, pSymbol);
281+ return CDbgHelpModule::SymGetSymNext(m_hObject, pSymbol);
282282 }
283283
284284 /**********************************************************************//**
@@ -291,7 +291,7 @@
291291 *//***********************************************************************/
292292 BOOL CSymbol::GetSymPrev(PIMAGEHLP_SYMBOL pSymbol) const
293293 {
294- return ::SymGetSymPrev(m_hObject, pSymbol);
294+ return CDbgHelpModule::SymGetSymPrev(m_hObject, pSymbol);
295295 }
296296
297297 /**********************************************************************//**
@@ -304,7 +304,7 @@
304304 *//***********************************************************************/
305305 XDWORD CSymbol::GetModuleBase(XDWORD dwAddr) const
306306 {
307- return ::SymGetModuleBase(m_hObject, dwAddr);
307+ return CDbgHelpModule::SymGetModuleBase(m_hObject, dwAddr);
308308 }
309309
310310 /**********************************************************************//**
@@ -318,7 +318,7 @@
318318 *//***********************************************************************/
319319 BOOL CSymbol::GetModuleInfo(XDWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo) const
320320 {
321- return ::SymGetModuleInfo(m_hObject, dwAddr, ModuleInfo);
321+ return CDbgHelpModule::SymGetModuleInfo(m_hObject, dwAddr, ModuleInfo);
322322 }
323323
324324 /**********************************************************************//**
@@ -332,7 +332,7 @@
332332 *//***********************************************************************/
333333 BOOL CSymbol::GetSearchPath(PSTR SearchPath, DWORD SearchPathLength) const
334334 {
335- return ::SymGetSearchPath(m_hObject, SearchPath, SearchPathLength);
335+ return CDbgHelpModule::SymGetSearchPath(m_hObject, SearchPath, SearchPathLength);
336336 }
337337
338338 /**********************************************************************//**
@@ -345,7 +345,7 @@
345345 *//***********************************************************************/
346346 BOOL CSymbol::SetSearchPath(PSTR SearchPath)
347347 {
348- return ::SymSetSearchPath(m_hObject, SearchPath);
348+ return CDbgHelpModule::SymSetSearchPath(m_hObject, SearchPath);
349349 }
350350
351351 /**********************************************************************//**
@@ -360,9 +360,9 @@
360360 BOOL CSymbol::RegisterCallback(PSYMBOL_REGISTERED_CALLBACK pfnCallback, PVOID pUserData)
361361 {
362362 #if defined(_IMAGEHLP64)
363- return ::SymRegisterCallback(m_hObject, pfnCallback, (ULONG64)pUserData);
363+ return CDbgHelpModule::SymRegisterCallback(m_hObject, pfnCallback, (ULONG64)pUserData);
364364 #else
365- return ::SymRegisterCallback(m_hObject, pfnCallback, pUserData);
365+ return CDbgHelpModule::SymRegisterCallback(m_hObject, pfnCallback, pUserData);
366366 #endif
367367 }
368368
@@ -378,9 +378,9 @@
378378 BOOL CSymbol::RegisterFunctionEntryCallback(PSYMBOL_FUNCENTRY_CALLBACK pfnCallback, PVOID pUserData)
379379 {
380380 #if defined(_IMAGEHLP64)
381- return ::SymRegisterFunctionEntryCallback(m_hObject, pfnCallback, (ULONG64)pUserData);
381+ return CDbgHelpModule::SymRegisterFunctionEntryCallback(m_hObject, pfnCallback, (ULONG64)pUserData);
382382 #else
383- return ::SymRegisterFunctionEntryCallback(m_hObject, pfnCallback, pUserData);
383+ return CDbgHelpModule::SymRegisterFunctionEntryCallback(m_hObject, pfnCallback, pUserData);
384384 #endif
385385 }
386386
@@ -393,7 +393,7 @@
393393 *//***********************************************************************/
394394 DWORD CSymbol::GetOptions(void)
395395 {
396- return ::SymGetOptions();
396+ return CDbgHelpModule::SymGetOptions();
397397 }
398398
399399 /**********************************************************************//**
@@ -406,7 +406,7 @@
406406 *//***********************************************************************/
407407 DWORD CSymbol::SetOptions(DWORD newOptions)
408408 {
409- return ::SymSetOptions(newOptions);
409+ return CDbgHelpModule::SymSetOptions(newOptions);
410410 }
411411
412412 } // end of namespace wx
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.cpp (revision 260)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXStackWalker.cpp (revision 261)
@@ -165,7 +165,7 @@
165165 #else
166166 const DWORD machineType = IMAGE_FILE_MACHINE_UNKNOWN;
167167 #endif
168- if( !::StackWalk(machineType
168+ if( !CDbgHelpModule::StackWalk(machineType
169169 , m_Symbol, m_Thread
170170 , &m_Frame, &m_Context, ReadMemoryRoutine
171171 , FunctionTableAccessRoutine, GetModuleBaseRoutine, TranslateAddress) )
--- trunk/framework/src/web/nacl/input/NaclInputEvent.h (revision 260)
+++ trunk/framework/src/web/nacl/input/NaclInputEvent.h (revision 261)
@@ -54,45 +54,62 @@
5454 virtual bool OnKeyUp (const pp::KeyboardInputEvent& rEvent) { return false; }
5555 virtual bool OnKeyChar (const pp::KeyboardInputEvent& rEvent) { return false; }
5656
57+protected:
58+ virtual bool OnMouseEvent(const pp::MouseInputEvent& rEvent, PP_InputEvent_Type type)
59+ {
60+ switch(type)
61+ {
62+ case PP_INPUTEVENT_TYPE_MOUSEDOWN:
63+ return OnMouseDown(rEvent.GetPosition(), rEvent);
64+ case PP_INPUTEVENT_TYPE_MOUSEUP:
65+ return OnMouseUp(rEvent.GetPosition(), rEvent);
66+ case PP_INPUTEVENT_TYPE_MOUSEMOVE:
67+ return OnMouseMove(rEvent.GetPosition(), rEvent);
68+ case PP_INPUTEVENT_TYPE_MOUSEENTER:
69+ return OnMouseEnter(rEvent.GetPosition(), rEvent);
70+ case PP_INPUTEVENT_TYPE_MOUSELEAVE:
71+ return OnMouseLeave(rEvent.GetPosition(), rEvent);
72+ case PP_INPUTEVENT_TYPE_CONTEXTMENU:
73+ return OnContextMenu(rEvent.GetPosition(), rEvent);
74+ break;
75+ default:
76+ break;
77+ }
78+ return false;
79+ }
80+
81+ virtual bool OnKeyboardEvent(const pp::KeyboardInputEvent& rEvent, PP_InputEvent_Type type)
82+ {
83+ switch(type)
84+ {
85+ case PP_INPUTEVENT_TYPE_RAWKEYDOWN:
86+ return OnRawKeyDown(rEvent);
87+ case PP_INPUTEVENT_TYPE_KEYDOWN:
88+ return OnKeyDown(rEvent);
89+ case PP_INPUTEVENT_TYPE_KEYUP:
90+ return OnKeyUp(rEvent);
91+ case PP_INPUTEVENT_TYPE_CHAR:
92+ return OnKeyChar(rEvent);
93+ default:
94+ break;
95+ }
96+ return false;
97+ }
5798 public:
5899 virtual bool HandleInputEvent(const pp::InputEvent& rEvent)
59100 {
60- switch(rEvent.GetType())
101+ PP_InputEvent_Type type = rEvent.GetType();
102+ switch(type)
61103 {
62104 case PP_INPUTEVENT_TYPE_MOUSEDOWN:
63- {
64- pp::MouseInputEvent mouse(rEvent);
65- return OnMouseDown(mouse.GetPosition(), mouse);
66- }
67- break;
68105 case PP_INPUTEVENT_TYPE_MOUSEUP:
69- {
70- pp::MouseInputEvent mouse(rEvent);
71- return OnMouseUp(mouse.GetPosition(), mouse);
72- }
73- break;
74106 case PP_INPUTEVENT_TYPE_MOUSEMOVE:
75- {
76- pp::MouseInputEvent mouse(rEvent);
77- return OnMouseMove(mouse.GetPosition(), mouse);
78- }
79- break;
80107 case PP_INPUTEVENT_TYPE_MOUSEENTER:
81- {
82- pp::MouseInputEvent mouse(rEvent);
83- return OnMouseEnter(mouse.GetPosition(), mouse);
84- }
85- break;
86108 case PP_INPUTEVENT_TYPE_MOUSELEAVE:
87- {
88- pp::MouseInputEvent mouse(rEvent);
89- return OnMouseLeave(mouse.GetPosition(), mouse);
90- }
91- break;
92109 case PP_INPUTEVENT_TYPE_CONTEXTMENU:
93110 {
94111 pp::MouseInputEvent mouse(rEvent);
95- return OnContextMenu(mouse.GetPosition(), mouse);
112+ return OnMouseEvent(mouse, type);
96113 }
97114 break;
98115
@@ -104,27 +121,12 @@
104121 break;
105122
106123 case PP_INPUTEVENT_TYPE_RAWKEYDOWN:
107- {
108- pp::KeyboardInputEvent key(rEvent);
109- return OnRawKeyDown(key);
110- }
111- break;
112124 case PP_INPUTEVENT_TYPE_KEYDOWN:
113- {
114- pp::KeyboardInputEvent key(rEvent);
115- return OnKeyDown(key);
116- }
117- break;
118125 case PP_INPUTEVENT_TYPE_KEYUP:
119- {
120- pp::KeyboardInputEvent key(rEvent);
121- return OnKeyUp(key);
122- }
123- break;
124126 case PP_INPUTEVENT_TYPE_CHAR:
125127 {
126128 pp::KeyboardInputEvent key(rEvent);
127- return OnKeyChar(key);
129+ return OnKeyboardEvent(key, type);
128130 }
129131 break;
130132
--- trunk/framework/src/web/nacl/core/NaclInstance.h (revision 260)
+++ trunk/framework/src/web/nacl/core/NaclInstance.h (revision 261)
@@ -77,7 +77,6 @@
7777
7878 std::string message = var_message.AsString();
7979 pp::Var exception;
80- pp::Var ret;
8180 std::vector<pp::Var> args;
8281 std::string method;
8382 {
@@ -103,15 +102,14 @@
103102
104103 if( m_ScriptObj.HasMethod(method, &exception) )
105104 {
106- ret = m_ScriptObj.Call(method, args, &exception);
105+ pp::Var ret = m_ScriptObj.Call(method, args, &exception);
106+ PostMessage( ret );
107107 }
108- PostMessage( ret );
109108 }
110109
111110 protected:
112111 virtual bool HandleInputEvent(const pp::InputEvent& rEvent)
113112 {
114- PostMessage("HandleInputEvent");
115113 if( m_pInputHandler != nullptr ) return m_pInputHandler->HandleInputEvent(rEvent);
116114 return false;
117115 }
--- trunk/framework/src/fnd/image/FndYUVPack.h (nonexistent)
+++ trunk/framework/src/fnd/image/FndYUVPack.h (revision 261)
@@ -0,0 +1,215 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file FndYUVPack.h
5+ * @brief YUVPack ファイル
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_FndYUVPack_H_
18+#define INCG_IRIS_FndYUVPack_H_
19+
20+//======================================================================
21+// include
22+#include "../../iris_object.h"
23+
24+namespace iris {
25+namespace fnd
26+{
27+
28+//======================================================================
29+// struct
30+/**
31+ * @brief U Y V Y
32+*/
33+typedef struct tagUYVY_PACK
34+{
35+ u8 u0, y0, v0, y1;
36+} UYVY_PACK;
37+
38+/**
39+ * @brief Y U Y V
40+*/
41+typedef struct tagYUV422_PACK
42+{
43+ u8 y0, u0, y1, v0;
44+} YUV422_PACK;
45+
46+/**
47+ * @brief Y V Y U
48+*/
49+typedef struct tagYVYU_PACK
50+{
51+ u8 y0, v0, y1, u0;
52+} YVYU_PACK;
53+
54+//======================================================================
55+// class
56+/**
57+ * @brief YUV 422
58+ * @tparam YUV422PACK_ : パックタイプ
59+*/
60+template<typename YUV422PACK_>
61+class CYUV422Pack : public IIrisObject
62+{
63+public:
64+ typedef YUV422PACK_ pack_t;
65+private:
66+ pack_t m_Pack;
67+
68+public:
69+ static int kPixelCount = 2;
70+public:
71+ /**
72+ * @brief パックが保持しているピクセル数
73+ * @return ピクセル数
74+ */
75+ int GetCount(void) const { return kPixelCount; }
76+
77+ /**
78+ * @biref パックからYUV取得
79+ * @tparam 受け取り YUV クラス
80+ * @param [in] yuv = yuv クラス
81+ * @param [in] index = インデックス
82+ */
83+ template<typename CYUV>
84+ void GetYUV(CYUV& yuv, int index) const
85+ {
86+ yuv.u(m_Pack.u0);
87+ yuv.y(index == 0 ? m_Pack.y0 : m_Pack.y1);
88+ yuv.u(m_Pack.v0);
89+ }
90+ /**
91+ * @biref パックにYUV設定
92+ * @tparam 受け取り YUV クラス
93+ * @param [in] yuv = yuv クラス
94+ * @param [in] index = インデックス
95+ */
96+ template<typename CYUV>
97+ void SetYUV(CYUV& yuv, int index)
98+ {
99+ m_Pack.u0 = yuv.u();
100+ index == 0 ? m_Pack.y0 = yuv.y() : m_Pack.y1 = yuv.y();
101+ m_Pack.v0 = yuv.v();
102+ }
103+};
104+
105+/**
106+ * @brief YUV 411
107+*/
108+class CYUV411Pack : public IIrisObject
109+{
110+ struct IYU1
111+ {
112+ u8 u0, y0, y1, v0, y2, y3;
113+ };
114+public:
115+ typedef IYU1 pack_t;
116+private:
117+ pack_t m_Pack;
118+
119+public:
120+ static int kPixelCount = 4;
121+
122+public:
123+ /**
124+ * @brief パックが保持しているピクセル数
125+ * @return ピクセル数
126+ */
127+ int GetCount(void) const { return kPixelCount; }
128+
129+ /**
130+ * @biref パックからYUV取得
131+ * @tparam 受け取り YUV クラス
132+ * @param [in] yuv = yuv クラス
133+ * @param [in] index = インデックス
134+ */
135+ template<typename CYUV>
136+ void GetYUV(CYUV& yuv, int index) const
137+ {
138+ yuv.u(m_Pack.u0);
139+ u8* py = (index&2) == 0 ? &m_Pack.y0 : &m_Pack.y1;
140+ yuv.y(*(py + (index&1)));
141+ yuv.u(m_Pack.v0);
142+ }
143+ /**
144+ * @biref パックにYUV設定
145+ * @tparam 受け取り YUV クラス
146+ * @param [in] yuv = yuv クラス
147+ * @param [in] index = インデックス
148+ */
149+ template<typename CYUV>
150+ void SetYUV(CYUV& yuv, int index)
151+ {
152+ m_Pack.u0 = yuv.u();
153+ u8* py = (index&2) == 0 ? &m_Pack.y0 : &m_Pack.y1;
154+ *(py + (index&1)) = yuv.y();
155+ m_Pack.v0 = yuv.v();
156+ }
157+};
158+
159+/**
160+ * @brief YUV 444
161+*/
162+class CYUV444Pack : public IIrisObject
163+{
164+ struct IYU2
165+ {
166+ u8 u0, y0, v0;
167+ };
168+public:
169+ typedef IYU1 pack_t;
170+private:
171+ pack_t m_Pack;
172+
173+public:
174+ static int kPixelCount = 1;
175+
176+public:
177+ /**
178+ * @brief パックが保持しているピクセル数
179+ * @return ピクセル数
180+ */
181+ int GetCount(void) const { return kPixelCount; }
182+
183+ /**
184+ * @biref パックからYUV取得
185+ * @tparam 受け取り YUV クラス
186+ * @param [in] yuv = yuv クラス
187+ * @param [in] index = インデックス
188+ */
189+ template<typename CYUV>
190+ void GetYUV(CYUV& yuv, int index) const
191+ {
192+ yuv.u(m_Pack.u0);
193+ yuv.y(m_Pack.y0);
194+ yuv.u(m_Pack.v0);
195+ }
196+ /**
197+ * @biref パックにYUV設定
198+ * @tparam 受け取り YUV クラス
199+ * @param [in] yuv = yuv クラス
200+ * @param [in] index = インデックス
201+ */
202+ template<typename CYUV>
203+ void SetYUV(CYUV& yuv, int index)
204+ {
205+ m_Pack.u0 = yuv.u();
206+ m_Pack.y0 = yuv.y();
207+ m_Pack.v0 = yuv.v();
208+ }
209+};
210+
211+
212+} // end of namespace fnd
213+} // end of namespace iris
214+
215+#endif
--- trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 261)
@@ -22,11 +22,11 @@
2222
2323 //======================================================================
2424 // define
25-#define IUTEST_VER 0x00140001 //!< iutest version 0.14.0.1
25+#define IUTEST_VER 0x00140002 //!< iutest version 0.14.0.2
2626 #define IUTEST_MAJORVER 0x00
2727 #define IUTEST_MINORVER 0x14
2828 #define IUTEST_BUILD 0x00
29-#define IUTEST_REVISION 0x01
29+#define IUTEST_REVISION 0x02
3030
3131 /**
3232 * @file iutest_ver.h
@@ -34,7 +34,7 @@
3434 <ul>
3535 <li>v0.14.0.1
3636 <ul>
37- <li>googletest との相互互換対応</li>
37+ <li>RecoredProperty 対応</li>
3838 </ul>
3939 </li>
4040 <li>v0.13.0.1
--- trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 261)
@@ -35,16 +35,6 @@
3535 # define IUTEST_PRINTF printf
3636 #endif
3737
38-// console
39-#define IUTEST_MBS_CODE_UNKOWN 0
40-#define IUTEST_MBS_CODE_UTF8 1
41-#define IUTEST_MBS_CODE_WINDOWS31J 2
42-#if defined(IUTEST_OS_WINDOWS)
43-# define IUTEST_MBS_CODE IUTEST_MBS_CODE_WINDOWS31J
44-#else
45-# define IUTEST_MBS_CODE IUTEST_MBS_CODE_UTF8
46-#endif
47-
4838 // support
4939 #ifndef IUTEST_HAS_PARAM_TEST
5040 # define IUTEST_HAS_PARAM_TEST 1
--- trunk/framework/testsuite/iutest/include/internal/iutest_charcode.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_charcode.h (revision 261)
@@ -110,7 +110,7 @@
110110 * @param [in] num = 入力バッファサイズ
111111 * @return UTF8 文字列
112112 */
113-static std::string WideStringToUTF8(const wchar_t* str, int num=-1)
113+static std::string IUTEST_ATTRIBUTE_UNUSED_ WideStringToUTF8(const wchar_t* str, int num=-1)
114114 {
115115 if( num == -1 )
116116 num = static_cast<int>(wcslen(str));
--- trunk/framework/testsuite/iutest/include/internal/iutest_compiler.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_compiler.h (revision 261)
@@ -232,7 +232,7 @@
232232 #if defined(_MSC_VER)
233233 # define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_MSC(warning (disable:4389))
234234 #elif defined(__GNUC__)
235-# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wno-sign-compare")
235+# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wsign-compare")
236236 #else
237237 # define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE()
238238 #endif
--- trunk/framework/testsuite/iutest/include/internal/iutest_internal_defs.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_internal_defs.h (revision 261)
@@ -36,6 +36,17 @@
3636
3737 #define IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING(statement) if( iutest::detail::AlwaysTrue() ) statement
3838
39+// console
40+#define IUTEST_MBS_CODE_UNKOWN 0
41+#define IUTEST_MBS_CODE_UTF8 1
42+#define IUTEST_MBS_CODE_WINDOWS31J 2
43+#if defined(IUTEST_OS_WINDOWS)
44+# define IUTEST_MBS_CODE IUTEST_MBS_CODE_WINDOWS31J
45+#else
46+# define IUTEST_MBS_CODE IUTEST_MBS_CODE_UTF8
47+#endif
48+
49+
3950 #ifndef NULL
4051 # ifdef __cplusplus
4152 # define NULL 0
--- trunk/framework/testsuite/iutest/include/internal/iutest_os.h (revision 260)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_os.h (revision 261)
@@ -19,7 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "../iutest_defs.h"
22+#include "iutest_internal_defs.h"
2323
2424 namespace iutest {
2525 namespace detail
Show on old repository browser