diff options
author | Allan CORNET <allan.cornet@scilab.org> | 2010-03-08 11:26:32 +0100 |
---|---|---|
committer | Allan CORNET <allan.cornet@scilab.org> | 2010-03-08 11:26:32 +0100 |
commit | 84baed453bbb49a0c9a0a02eefaad8e59c356600 (patch) | |
tree | 3fef6967fdb94b1ca3d11665dd49e152f486e5af | |
parent | 0be783d0eeecaa54618e928628ec7737a33d11ac (diff) | |
download | scilab-breakpad.zip scilab-breakpad.tar.gz |
breakpad on Windows (wscilex)breakpad
-rw-r--r-- | scilab/libs/.gitignore | 1 | ||||
-rw-r--r-- | scilab/modules/core/sci_gateway/c/sci_getmd5.c | 6 | ||||
-rw-r--r-- | scilab/modules/windows_tools/src/c/WScilex/WScilex.c | 16 | ||||
-rw-r--r-- | scilab/modules/windows_tools/src/c/WScilex/WScilex.vcproj | 22 | ||||
-rw-r--r-- | scilab/modules/windows_tools/src/c/WScilex/breakpad.cpp | 46 | ||||
-rw-r--r-- | scilab/modules/windows_tools/src/c/WScilex/breakpad.h | 27 |
6 files changed, 93 insertions, 25 deletions
diff --git a/scilab/libs/.gitignore b/scilab/libs/.gitignore index ee79b2a..c8a40fc 100644 --- a/scilab/libs/.gitignore +++ b/scilab/libs/.gitignore | |||
@@ -13,5 +13,6 @@ umfpack | |||
13 | zlib | 13 | zlib |
14 | hdf5 | 14 | hdf5 |
15 | gl2ps | 15 | gl2ps |
16 | google_breakpad | ||
16 | *.lib | 17 | *.lib |
17 | 18 | ||
diff --git a/scilab/modules/core/sci_gateway/c/sci_getmd5.c b/scilab/modules/core/sci_gateway/c/sci_getmd5.c index e1fb0d8..caa81ed 100644 --- a/scilab/modules/core/sci_gateway/c/sci_getmd5.c +++ b/scilab/modules/core/sci_gateway/c/sci_getmd5.c | |||
@@ -38,13 +38,15 @@ int C2F(sci_getmd5) (char *fname,unsigned long fname_len) | |||
38 | char **Input_Matrix = NULL; | 38 | char **Input_Matrix = NULL; |
39 | char **Output_Matrix = NULL; | 39 | char **Output_Matrix = NULL; |
40 | 40 | ||
41 | /* @TODO Remove this. This is crashing on purpose Scilab to test breakpad */ | ||
42 | int *a = NULL; | ||
43 | |||
41 | Rhs = Max(Rhs, 0); | 44 | Rhs = Max(Rhs, 0); |
42 | CheckRhs(1,2) ; | 45 | CheckRhs(1,2) ; |
43 | CheckLhs(1,1) ; | 46 | CheckLhs(1,1) ; |
44 | 47 | ||
45 | /* @TODO Remove this. This is crashing on purpose Scilab to test breakpad */ | 48 | /* @TODO Remove this. This is crashing on purpose Scilab to test breakpad */ |
46 | int *a=NULL; | 49 | *a = 23; |
47 | *a=23; | ||
48 | 50 | ||
49 | if (Rhs == 1) | 51 | if (Rhs == 1) |
50 | { | 52 | { |
diff --git a/scilab/modules/windows_tools/src/c/WScilex/WScilex.c b/scilab/modules/windows_tools/src/c/WScilex/WScilex.c index 0e6173e..e1e4395 100644 --- a/scilab/modules/windows_tools/src/c/WScilex/WScilex.c +++ b/scilab/modules/windows_tools/src/c/WScilex/WScilex.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <stdio.h> | 14 | #include <stdio.h> |
15 | #include "GetWindowsVersion.h" | 15 | #include "GetWindowsVersion.h" |
16 | #include "win_mem_alloc.h" /* MALLOC */ | 16 | #include "win_mem_alloc.h" /* MALLOC */ |
17 | #include "breakpad.h" | ||
17 | /*--------------------------------------------------------------------------*/ | 18 | /*--------------------------------------------------------------------------*/ |
18 | #define MSG_DETECT_2K_OR_MORE "Scilab requires Windows 2000 or more." | 19 | #define MSG_DETECT_2K_OR_MORE "Scilab requires Windows 2000 or more." |
19 | #define MSG_DETECT_SSE_OR_MORE "Scilab requires SSE Instructions." | 20 | #define MSG_DETECT_SSE_OR_MORE "Scilab requires SSE Instructions." |
@@ -59,22 +60,13 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR szCmdLine | |||
59 | fRunTimeLinkSuccess = TRUE; | 60 | fRunTimeLinkSuccess = TRUE; |
60 | 61 | ||
61 | #ifndef _DEBUG | 62 | #ifndef _DEBUG |
62 | /* catch system errors msgbox (release mode only) */ | 63 | /* initialize breakpad just before true main */ |
63 | /* http://msdn.microsoft.com/en-us/library/ms680621(VS.85).aspx */ | 64 | /* disable in debug mode to access to VS debugger */ |
64 | // LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX ); | 65 | initializeBreakPad(); |
65 | _try | ||
66 | { | ||
67 | #endif | 66 | #endif |
68 | |||
69 | /* launch main */ | 67 | /* launch main */ |
70 | (Windows_Main)(hInstance,hPrevInstance,szCmdLine, iCmdShow); | 68 | (Windows_Main)(hInstance,hPrevInstance,szCmdLine, iCmdShow); |
71 | 69 | ||
72 | #ifndef _DEBUG | ||
73 | } | ||
74 | _except (EXCEPTION_EXECUTE_HANDLER) | ||
75 | { | ||
76 | } | ||
77 | #endif | ||
78 | 70 | ||
79 | } | 71 | } |
80 | fFreeResult = FreeLibrary(hinstLib); | 72 | fFreeResult = FreeLibrary(hinstLib); |
diff --git a/scilab/modules/windows_tools/src/c/WScilex/WScilex.vcproj b/scilab/modules/windows_tools/src/c/WScilex/WScilex.vcproj index 12ad333..fbfc248 100644 --- a/scilab/modules/windows_tools/src/c/WScilex/WScilex.vcproj +++ b/scilab/modules/windows_tools/src/c/WScilex/WScilex.vcproj | |||
@@ -1,4 +1,4 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="Windows-1252"?> |
2 | <VisualStudioProject | 2 | <VisualStudioProject |
3 | ProjectType="Visual C++" | 3 | ProjectType="Visual C++" |
4 | Version="9,00" | 4 | Version="9,00" |
@@ -45,7 +45,7 @@ | |||
45 | Name="VCCLCompilerTool" | 45 | Name="VCCLCompilerTool" |
46 | AdditionalOptions="" | 46 | AdditionalOptions="" |
47 | Optimization="0" | 47 | Optimization="0" |
48 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows"" | 48 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client\windows\handler"" |
49 | PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE" | 49 | PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE" |
50 | MinimalRebuild="true" | 50 | MinimalRebuild="true" |
51 | BasicRuntimeChecks="0" | 51 | BasicRuntimeChecks="0" |
@@ -128,7 +128,7 @@ | |||
128 | <Tool | 128 | <Tool |
129 | Name="VCCLCompilerTool" | 129 | Name="VCCLCompilerTool" |
130 | Optimization="0" | 130 | Optimization="0" |
131 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows"" | 131 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client\windows\handler"" |
132 | PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE" | 132 | PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE" |
133 | MinimalRebuild="true" | 133 | MinimalRebuild="true" |
134 | BasicRuntimeChecks="0" | 134 | BasicRuntimeChecks="0" |
@@ -211,7 +211,7 @@ | |||
211 | Name="VCCLCompilerTool" | 211 | Name="VCCLCompilerTool" |
212 | AdditionalOptions="" | 212 | AdditionalOptions="" |
213 | FavorSizeOrSpeed="1" | 213 | FavorSizeOrSpeed="1" |
214 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows"" | 214 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client\windows\handler"" |
215 | PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_DEPRECATE" | 215 | PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_DEPRECATE" |
216 | RuntimeLibrary="2" | 216 | RuntimeLibrary="2" |
217 | EnableEnhancedInstructionSet="0" | 217 | EnableEnhancedInstructionSet="0" |
@@ -295,7 +295,7 @@ | |||
295 | <Tool | 295 | <Tool |
296 | Name="VCCLCompilerTool" | 296 | Name="VCCLCompilerTool" |
297 | FavorSizeOrSpeed="1" | 297 | FavorSizeOrSpeed="1" |
298 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows"" | 298 | AdditionalIncludeDirectories=""$(SolutionDir)libs\DetectFramework2";"$(SolutionDir)libs\GetWindowsVersion";"$(SolutionDir)modules\core\includes";"$(SolutionDir)libs\MALLOC\includes";"$(SolutionDir)modules\windows_tools\src\c\scilab_windows";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client";"D:\GIT-scilab-master\scilab_breakpad\scilab\libs\google_breakpad\includes\client\windows\handler"" |
299 | PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_DEPRECATE" | 299 | PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_DEPRECATE" |
300 | RuntimeLibrary="2" | 300 | RuntimeLibrary="2" |
301 | EnableEnhancedInstructionSet="0" | 301 | EnableEnhancedInstructionSet="0" |
@@ -363,6 +363,10 @@ | |||
363 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | 363 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
364 | > | 364 | > |
365 | <File | 365 | <File |
366 | RelativePath=".\breakpad.cpp" | ||
367 | > | ||
368 | </File> | ||
369 | <File | ||
366 | RelativePath=".\WScilex.c" | 370 | RelativePath=".\WScilex.c" |
367 | > | 371 | > |
368 | </File> | 372 | </File> |
@@ -373,15 +377,11 @@ | |||
373 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | 377 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" |
374 | > | 378 | > |
375 | <File | 379 | <File |
376 | RelativePath=".\resource.h" | 380 | RelativePath=".\breakpad.h" |
377 | > | ||
378 | </File> | ||
379 | <File | ||
380 | RelativePath="..\scilab_windows\setDOCBOOK_ROOT.h" | ||
381 | > | 381 | > |
382 | </File> | 382 | </File> |
383 | <File | 383 | <File |
384 | RelativePath="..\scilab_windows\setLC_MESSAGES.h" | 384 | RelativePath=".\resource.h" |
385 | > | 385 | > |
386 | </File> | 386 | </File> |
387 | </Filter> | 387 | </Filter> |
diff --git a/scilab/modules/windows_tools/src/c/WScilex/breakpad.cpp b/scilab/modules/windows_tools/src/c/WScilex/breakpad.cpp new file mode 100644 index 0000000..b5caa5b --- /dev/null +++ b/scilab/modules/windows_tools/src/c/WScilex/breakpad.cpp | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | * Copyright (C) 2009 - DIGITEO - Allan CORNET | ||
4 | * | ||
5 | * This file must be used under the terms of the CeCILL. | ||
6 | * This source file is licensed as described in the file COPYING, which | ||
7 | * you should have received as part of this distribution. The terms | ||
8 | * are also available at | ||
9 | * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt | ||
10 | * | ||
11 | */ | ||
12 | /*--------------------------------------------------------------------------*/ | ||
13 | #include <windows.h> | ||
14 | #include <exception_handler.h> | ||
15 | #include "breakpad.h" | ||
16 | /*--------------------------------------------------------------------------*/ | ||
17 | #pragma comment(lib,"../../../../../libs/google_breakpad/exception_handler.lib") | ||
18 | /*--------------------------------------------------------------------------*/ | ||
19 | using namespace google_breakpad; | ||
20 | /*--------------------------------------------------------------------------*/ | ||
21 | static ExceptionHandler* handler = NULL; | ||
22 | /*--------------------------------------------------------------------------*/ | ||
23 | bool MinidumpCallback(const wchar_t* dump_path, | ||
24 | const wchar_t* minidump_id, | ||
25 | void* context, | ||
26 | EXCEPTION_POINTERS* exinfo, | ||
27 | MDRawAssertionInfo* assertion, | ||
28 | bool succeeded) | ||
29 | { | ||
30 | MessageBox(NULL, L"breakpad : exception detected", L"", MB_ICONWARNING); | ||
31 | return succeeded; | ||
32 | } | ||
33 | /*--------------------------------------------------------------------------*/ | ||
34 | void initializeBreakPad(void) | ||
35 | { | ||
36 | static ExceptionHandler* handler = NULL; | ||
37 | handler = new ExceptionHandler(L".", | ||
38 | NULL, | ||
39 | MinidumpCallback, | ||
40 | NULL, | ||
41 | ExceptionHandler::HANDLER_ALL, | ||
42 | MiniDumpNormal, | ||
43 | NULL, | ||
44 | NULL); | ||
45 | } | ||
46 | /*--------------------------------------------------------------------------*/ | ||
diff --git a/scilab/modules/windows_tools/src/c/WScilex/breakpad.h b/scilab/modules/windows_tools/src/c/WScilex/breakpad.h new file mode 100644 index 0000000..f3f1968 --- /dev/null +++ b/scilab/modules/windows_tools/src/c/WScilex/breakpad.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | * Copyright (C) 2009 - DIGITEO - Allan CORNET | ||
4 | * | ||
5 | * This file must be used under the terms of the CeCILL. | ||
6 | * This source file is licensed as described in the file COPYING, which | ||
7 | * you should have received as part of this distribution. The terms | ||
8 | * are also available at | ||
9 | * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __BREAKPAD_H__ | ||
14 | #define __BREAKPAD_H__ | ||
15 | |||
16 | #ifdef __cplusplus | ||
17 | extern "C" | ||
18 | { | ||
19 | #endif | ||
20 | |||
21 | void initializeBreakPad(void); | ||
22 | |||
23 | #ifdef __cplusplus | ||
24 | }; | ||
25 | #endif /* extern "C" */ | ||
26 | |||
27 | #endif /* __BREAKPAD_H__ */ | ||