NVDA with Japanese branch
リビジョン | 76c24e5ac6b24fb0fbb62e9c9b330698d56d6030 (tree) |
---|---|
日時 | 2014-02-10 11:39:47 |
作者 | Takuya Nishimoto <nishimotz@gmai...> |
コミッター | Takuya Nishimoto |
merged origin master
@@ -38,6 +38,8 @@ launcher/nvda_logo.wav | ||
38 | 38 | uninstaller/UAC.nsh |
39 | 39 | *.pyc |
40 | 40 | *.pyo |
41 | + | |
42 | +*.dmp | |
41 | 43 | _*.cmd |
42 | 44 | __*.txt |
43 | 45 | source/brlapi.pyd |
@@ -1 +1 @@ | ||
1 | -Subproject commit fb32c71685dc9b930fad9074bb236114bde2a994 | |
1 | +Subproject commit b5ca1cf3018030210b097465588817f868fba395 |
@@ -1 +1 @@ | ||
1 | -Subproject commit 5624beb71a4261a0e207d93fe2024f829b87a9de | |
1 | +Subproject commit a6de92e01e7c68045e5f0976a9163d7b6abc9b97 |
@@ -36,13 +36,12 @@ env.Append(LINKFLAGS=['/incremental:no','/WX']) | ||
36 | 36 | env.Append(LINKFLAGS='/release') #We always want a checksum in the header |
37 | 37 | env.Append(MIDLFLAGS='/x64' if TARGET_ARCH=='x86_64' else '/win32') |
38 | 38 | |
39 | -if 'noOptimize' in debug: | |
39 | +if not release: | |
40 | 40 | env.Append(CCFLAGS=['/Od']) |
41 | 41 | else: |
42 | 42 | env.Append(CCFLAGS='/O2') |
43 | - if release: | |
44 | - env.Append(CCFLAGS='/GL') | |
45 | - env.Append(LINKFLAGS=['/LTCG']) | |
43 | + env.Append(CCFLAGS='/GL') | |
44 | + env.Append(LINKFLAGS=['/LTCG']) | |
46 | 45 | |
47 | 46 | if 'debugCRT' in debug: |
48 | 47 | env.Append(CCFLAGS=['/MTd']) |
@@ -53,9 +52,10 @@ else: | ||
53 | 52 | if 'RTC' in debug: |
54 | 53 | env.Append(CCFLAGS=['/RTCsu']) |
55 | 54 | |
56 | -if 'symbols' in debug: | |
57 | - env.Append(PDB='${TARGET}.pdb') | |
58 | - env.Append(LINKFLAGS='/OPT:REF') #having symbols usually turns this off but we have no need for unused symbols | |
55 | + | |
56 | +#We always want debug symbols | |
57 | +env.Append(PDB='${TARGET}.pdb') | |
58 | +env.Append(LINKFLAGS='/OPT:REF') #having symbols usually turns this off but we have no need for unused symbols | |
59 | 59 | |
60 | 60 | Export('env') |
61 | 61 |
@@ -20,4 +20,5 @@ interface NvdaInProcUtils { | ||
20 | 20 | [fault_status,comm_status] winword_getTextInRange(); |
21 | 21 | [fault_status,comm_status] sysListView32_getGroupInfo(); |
22 | 22 | [fault_status,comm_status] getActiveObject(); |
23 | + [fault_status,comm_status] dumpOnCrash(); | |
23 | 24 | } |
@@ -51,4 +51,6 @@ interface NvdaInProcUtils { | ||
51 | 51 | |
52 | 52 | error_status_t getActiveObject([in] handle_t bindingHandle, [in,string] const wchar_t* progid, [out] IUnknown** ppUnknown); |
53 | 53 | |
54 | + error_status_t dumpOnCrash([in] handle_t bindingHandle, [in,string] const wchar_t* minidumpPath); | |
55 | + | |
54 | 56 | } |
@@ -9,6 +9,7 @@ EXPORTS | ||
9 | 9 | nvdaInProcUtils_registerNVDAProcess |
10 | 10 | nvdaInProcUtils_unregisterNVDAProcess |
11 | 11 | nvdaInProcUtils_sysListView32_getGroupInfo |
12 | + nvdaInProcUtils_dumpOnCrash | |
12 | 13 | nvdaInProcUtils_getActiveObject |
13 | 14 | nvdaInProcUtils_winword_expandToLine |
14 | 15 | nvdaInProcUtils_winword_getTextInRange |
@@ -16,6 +16,7 @@ http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
16 | 16 | #include <sstream> |
17 | 17 | #include <rpc.h> |
18 | 18 | #include <sddl.h> |
19 | +#include <DbgHelp.h> | |
19 | 20 | #include "nvdaControllerInternal.h" |
20 | 21 | #include <common/log.h> |
21 | 22 | #include "vbufRemote.h" |
@@ -128,3 +129,31 @@ error_status_t nvdaInProcUtils_getActiveObject(handle_t bindingHandle, const wch | ||
128 | 129 | } |
129 | 130 | return GetActiveObject(clsid,NULL,ppUnknown); |
130 | 131 | } |
132 | + | |
133 | +std::wstring minidumpPath; | |
134 | + | |
135 | +LONG WINAPI crashHandler(LPEXCEPTION_POINTERS exceptionInfo) { | |
136 | + HANDLE mdf = CreateFile(minidumpPath.c_str(), GENERIC_WRITE, 0, NULL, | |
137 | + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); | |
138 | + if (mdf == INVALID_HANDLE_VALUE) | |
139 | + return EXCEPTION_CONTINUE_SEARCH; | |
140 | + MINIDUMP_EXCEPTION_INFORMATION mdExc; | |
141 | + mdExc.ThreadId = GetCurrentThreadId(); | |
142 | + mdExc.ExceptionPointers = exceptionInfo; | |
143 | + mdExc.ClientPointers = FALSE; | |
144 | + MiniDumpWriteDump( | |
145 | + GetCurrentProcess(), GetCurrentProcessId(), | |
146 | + mdf, | |
147 | + MiniDumpNormal, | |
148 | + &mdExc, NULL, NULL); | |
149 | + CloseHandle(mdf); | |
150 | + return EXCEPTION_CONTINUE_SEARCH; | |
151 | +} | |
152 | + | |
153 | +error_status_t nvdaInProcUtils_dumpOnCrash(handle_t bindingHandle, const wchar_t* path) { | |
154 | + if (!path) | |
155 | + return E_FAIL; | |
156 | + minidumpPath = path; | |
157 | + SetUnhandledExceptionFilter(crashHandler); | |
158 | + return S_OK; | |
159 | +} |
@@ -114,6 +114,7 @@ remoteLib=env.SharedLibrary( | ||
114 | 114 | "imm32", |
115 | 115 | "advapi32", |
116 | 116 | "version", |
117 | + "DbgHelp", | |
117 | 118 | ], |
118 | 119 | ) |
119 | 120 |
@@ -20,7 +20,7 @@ env.Append(LINKFLAGS='/subsystem:windows') | ||
20 | 20 | remoteLoaderProgram=env.Program( |
21 | 21 | target='nvdaHelperRemoteLoader', |
22 | 22 | source=['loader.cpp'], |
23 | - LIBS=[remoteLib[1] if 'symbols' not in env['nvdaHelperDebugFlags'] else remoteLib[2],'kernel32'], | |
23 | + LIBS=[remoteLib[2],'kernel32'], | |
24 | 24 | ) |
25 | 25 | |
26 | 26 | Return('remoteLoaderProgram') |
@@ -8,6 +8,6 @@ vbufBaseObjs=[env.Object(x) for x in ( | ||
8 | 8 | "utils.cpp", |
9 | 9 | "backend.cpp", |
10 | 10 | )] |
11 | -vbufBaseObjs.append(remoteLib[1] if 'symbols' not in env['nvdaHelperDebugFlags'] else remoteLib[2]) | |
11 | +vbufBaseObjs.append(remoteLib[2]) | |
12 | 12 | |
13 | 13 | Return('vbufBaseObjs') |
@@ -24,7 +24,7 @@ The following dependencies are included in Git submodules: | ||
24 | 24 | * comtypes, version 0.6.2: http://sourceforge.net/projects/comtypes/ |
25 | 25 | * wxPython, version 2.8.12.1 unicode: http://www.wxpython.org/ |
26 | 26 | * Python Windows Extensions, build 218: http://sourceforge.net/projects/pywin32/ |
27 | -* eSpeak, version 1.47.11: http://espeak.sourceforge.net/ | |
27 | +* eSpeak, version 1.48.02: http://espeak.sourceforge.net/ | |
28 | 28 | * IAccessible2, version 1.3: http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2 |
29 | 29 | * ConfigObj, version 4.6.0: http://www.voidspace.org.uk/python/configobj.html |
30 | 30 | * liblouis, version 2.5.3: http://www.liblouis.org/ |
@@ -66,14 +66,19 @@ Though while simply testing or committing changes, it may be faster usually just | ||
66 | 66 | === Compiling NVDAHelper with Debugging Options === |
67 | 67 | Among other things, preparing the source tree builds the NVDAHelper libraries. |
68 | 68 | If trying to debug nvdaHelper, You can control various debugging options with the nvdaHelperDebugFlags command line variable. It takes one or more of the following flags: |
69 | - * symbols: debugging symbols will be added to the DLLs and pdb files will be generated for use with a debugger. (symbols are produced by default, but if specifying nvdaHelperDebugFlags and you want symbols it is still necessary to specify this keyword.) | |
70 | 69 | * debugCRT: the libraries will be linked against the debug C runtime and assertions will be enabled. (By default, the normal CRT is used and assertions are disabled.) |
71 | - * noOptimize: All compiler optimizations will be disabled. (Optimization 2 [/O2] is used by default.) | |
72 | 70 | * RTC: runtime checks (stack corruption, uninitialized variables, etc.) will be enabled. (The default is no runtime checks.) |
73 | 71 | The special keywords none and all can also be used in place of the individual flags. |
74 | 72 | |
75 | -An example follows that enables symbols and disables optimizations: | |
76 | -scons source nvdaHelperDebugFlags=symbols,noOptimize | |
73 | +An example follows that enables debug CRT and runtype checks | |
74 | +scons source nvdaHelperDebugFlags=debugCRT,RTC | |
75 | + | |
76 | +Symbol pdb files are always produced when building, regardless of the debug flags. | |
77 | +However, they are not included in the NVDA distribution. | |
78 | +Instead, scons symbolArchive will package them as a separate archive. | |
79 | + | |
80 | +By default, builds also do not use any compiler optimizations. | |
81 | +Please see the release keyword argument for what compiler optimizations it will enable. | |
77 | 82 | |
78 | 83 | == Running the Source Code == |
79 | 84 | To start NVDA from source code, run nvda.pyw located in the source directory. |
@@ -109,6 +114,8 @@ scons pot | ||
109 | 114 | Optionally, the build can be customised by providing variables on the command line: |
110 | 115 | * version: The version of this build. |
111 | 116 | * release: Whether this is a release version. |
117 | + * This enables various C++ compiler optimizations such as /O2 and whole-program optimization. | |
118 | + * It also instructs Python to generate optimized byte code. | |
112 | 119 | * publisher: The publisher of this build. |
113 | 120 | * certFile: The certificate file with which to sign executables. The certificate must be in pfx format and contain the private key. |
114 | 121 | * certPassword: The password for the private key in the signing certificate. If omitted, no password will be assumed. |
@@ -68,7 +68,7 @@ vars.Add(PathVariable("certFile", "The certificate file with which to sign execu | ||
68 | 68 | vars.Add("certPassword", "The password for the private key in the signing certificate", "") |
69 | 69 | vars.Add("certTimestampServer", "The URL of the timestamping server to use to timestamp authenticode signatures", "") |
70 | 70 | vars.Add(PathVariable("outputDir", "The directory where the final built archives and such will be placed", "output",PathVariable.PathIsDirCreate)) |
71 | -vars.Add(ListVariable("nvdaHelperDebugFlags", "a list of debugging features you require", 'symbols', ["symbols","debugCRT","RTC","noOptimize"])) | |
71 | +vars.Add(ListVariable("nvdaHelperDebugFlags", "a list of debugging features you require", 'none', ["debugCRT","RTC"])) | |
72 | 72 | vars.Add(EnumVariable('nvdaHelperLogLevel','The level of logging you wish to see, lower is more verbose','15',allowed_values=[str(x) for x in xrange(60)])) |
73 | 73 | |
74 | 74 | #Base environment for this and sub sconscripts |
@@ -17,6 +17,7 @@ import os | ||
17 | 17 | import sys |
18 | 18 | import pkgutil |
19 | 19 | import threading |
20 | +import tempfile | |
20 | 21 | import baseObject |
21 | 22 | import globalVars |
22 | 23 | from logHandler import log |
@@ -391,6 +392,16 @@ class AppModule(baseObject.ScriptableObject): | ||
391 | 392 | """ |
392 | 393 | return False |
393 | 394 | |
395 | + def dumpOnCrash(self): | |
396 | + """Request that this process writes a minidump when it crashes for debugging. | |
397 | + This should only be called if instructed by a developer. | |
398 | + """ | |
399 | + path = os.path.join(tempfile.gettempdir(), | |
400 | + "nvda_crash_%s_%d.dmp" % (self.appName, self.processID)).decode("mbcs") | |
401 | + NVDAHelper.localLib.nvdaInProcUtils_dumpOnCrash( | |
402 | + self.helperLocalBindingHandle, path) | |
403 | + print "Dump path: %s" % path | |
404 | + | |
394 | 405 | class AppProfileTrigger(config.ProfileTrigger): |
395 | 406 | """A configuration profile trigger for when a particular application has focus. |
396 | 407 | """ |
@@ -5,16 +5,19 @@ | ||
5 | 5 | #See the file COPYING for more details. |
6 | 6 | |
7 | 7 | import sys |
8 | +import os | |
8 | 9 | import traceback |
9 | 10 | import time |
10 | 11 | import threading |
11 | 12 | import inspect |
12 | 13 | from ctypes import windll, oledll |
13 | 14 | import ctypes.wintypes |
15 | +import msvcrt | |
14 | 16 | import comtypes |
15 | 17 | import winUser |
16 | 18 | import winKernel |
17 | 19 | from logHandler import log |
20 | +import globalVars | |
18 | 21 | |
19 | 22 | #settings |
20 | 23 | #: How often to check whether the core is alive |
@@ -119,11 +122,42 @@ def _recoverAttempt(): | ||
119 | 122 | import NVDAHelper |
120 | 123 | NVDAHelper.localLib.cancelSendMessage() |
121 | 124 | |
125 | +class MINIDUMP_EXCEPTION_INFORMATION(ctypes.Structure): | |
126 | + _fields_ = ( | |
127 | + ("ThreadId", ctypes.wintypes.DWORD), | |
128 | + ("ExceptionPointers", ctypes.c_void_p), | |
129 | + ("ClientPointers", ctypes.wintypes.BOOL), | |
130 | + ) | |
131 | + | |
122 | 132 | @ctypes.WINFUNCTYPE(ctypes.wintypes.LONG, ctypes.c_void_p) |
123 | 133 | def _crashHandler(exceptionInfo): |
134 | + threadId = ctypes.windll.kernel32.GetCurrentThreadId() | |
124 | 135 | # An exception might have been set for this thread. |
125 | 136 | # Clear it so that it doesn't get raised in this function. |
126 | - ctypes.pythonapi.PyThreadState_SetAsyncExc(threading.currentThread().ident, None) | |
137 | + ctypes.pythonapi.PyThreadState_SetAsyncExc(threadId, None) | |
138 | + | |
139 | + # Write a minidump. | |
140 | + dumpPath = os.path.abspath(os.path.join(globalVars.appArgs.logFileName, "..", "nvda_crash.dmp")) | |
141 | + try: | |
142 | + with file(dumpPath, "w") as mdf: | |
143 | + mdExc = MINIDUMP_EXCEPTION_INFORMATION(ThreadId=threadId, | |
144 | + ExceptionPointers=exceptionInfo, ClientPointers=False) | |
145 | + if not ctypes.windll.DbgHelp.MiniDumpWriteDump( | |
146 | + ctypes.windll.kernel32.GetCurrentProcess(), | |
147 | + os.getpid(), | |
148 | + msvcrt.get_osfhandle(mdf.fileno()), | |
149 | + 0, # MiniDumpNormal | |
150 | + ctypes.byref(mdExc), | |
151 | + None, | |
152 | + None | |
153 | + ): | |
154 | + raise ctypes.WinError() | |
155 | + except: | |
156 | + log.critical("NVDA crashed! Error writing minidump", exc_info=True) | |
157 | + else: | |
158 | + log.critical("NVDA crashed! Minidump written to %s" % dumpPath) | |
159 | + | |
160 | + log.info("Restarting due to crash") | |
127 | 161 | import core |
128 | 162 | core.restart() |
129 | 163 | return 1 # EXCEPTION_EXECUTE_HANDLER |
@@ -20,6 +20,7 @@ | ||
20 | 20 | - For Papenmeier braille displays, the move to flat review/focus command has been removed. Users can assign their own keys using the Input Gestures dialog. (#3652) |
21 | 21 | - NVDA now relies on the Microsoft VC runtime version 11, which means it can no longer be run on Operating systems older than Windows XP Service Pack 2 or Windows Server 2003 Service Pack 1. |
22 | 22 | - Punctuation level Some will now speak star (*) and plus (+) characters. (#3614) |
23 | +- Upgraded eSpeak to version 1.48.02 which includes many language fixes and fixes several crashes. (#3842, #3739) | |
23 | 24 | |
24 | 25 | |
25 | 26 | == Bug Fixes == |