]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/crashrpt.h
First step at moving the print (dialog) native
[wxWidgets.git] / include / wx / msw / crashrpt.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/crashrpt.h
3 // Purpose: helpers for the structured exception handling (SEH) under Win32
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 13.07.2003
7 // RCS-ID: $Id$
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MSW_SEH_H_
13 #define _WX_MSW_SEH_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_ON_FATAL_EXCEPTION
18
19 // ----------------------------------------------------------------------------
20 // report generation flags
21 // ----------------------------------------------------------------------------
22
23 enum
24 {
25 // we always report where the crash occured
26 wxCRASH_REPORT_LOCATION = 0,
27
28 // if this flag is given, the call stack is dumped
29 //
30 // this results in dump/crash report as small as possible, this is the
31 // default flag
32 wxCRASH_REPORT_STACK = 1,
33
34 // if this flag is given, the values of the local variables are dumped
35 //
36 // note that this will result in huge file containing the dump of the
37 // entire process memory space when using mini dumps!
38 wxCRASH_REPORT_LOCALS = 2,
39
40 // if this flag is given, the values of all global variables are dumped
41 //
42 // this creates a much larger mini dump and also takes more time to
43 // generate if our own crash reporting code is used
44 wxCRASH_REPORT_GLOBALS = 4
45 };
46
47 // ----------------------------------------------------------------------------
48 // wxCrashReport: this class is used to create crash reports
49 // ----------------------------------------------------------------------------
50
51 struct WXDLLIMPEXP_BASE wxCrashReport
52 {
53 // set the name of the file to which the report is written, it is
54 // constructed from the .exe name by default
55 static void SetFileName(const wxChar *filename);
56
57 // return the current file name
58 static const wxChar *GetFileName();
59
60 // write the exception report to the file, return true if it could be done
61 // or false otherwise
62 static bool Generate(int flags = wxCRASH_REPORT_LOCATION |
63 wxCRASH_REPORT_STACK);
64 };
65
66 #endif // wxUSE_ON_FATAL_EXCEPTION
67
68 #endif // _WX_MSW_SEH_H_
69