]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/debugrpt.tex
Applied patch [ 1174270 ] small fixes to wxGenericDirCtrl
[wxWidgets.git] / docs / latex / wx / debugrpt.tex
CommitLineData
4e0e7d39
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: debugrpt.tex
3%% Purpose: wxDebugReport documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 2005-03-21
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin 2005
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxDebugReport}}\label{wxdebugreport}
13
14wxDebugReport is used to generate a debug report, containing information about
15the program current state. It is usually used from
16\helpref{wxApp::OnFatalException()}{wxapponfatalexception} as shown in the
17\helpref{sample}{sampledebugrpt}.
18
802fa226 19A wxDebugReport object contains one or more files. A few of them can be created by the
4e0e7d39
VZ
20class itself but more can be created from the outside and then added to the
21report. Also note that several virtual functions may be overridden to further
22customize the class behaviour.
23
802fa226 24Once a report is fully assembled, it can simply be left in the temporary
4e0e7d39
VZ
25directory so that the user can email it to the developers (in which case you
26should still use \helpref{wxDebugReportCompress}{wxdebugreportcompress} to
27compress it in a single file) or uploaded to a Web server using
28\helpref{wxDebugReportUpload}{wxdebugreportupload} (setting up the Web server
802fa226 29to accept uploads is your responsibility, of course). Other handlers, for example for
4e0e7d39
VZ
30automatically emailing the report, can be defined as well but are not currently
31included in wxWidgets.
32
33\wxheading{Example of use}
34
35\begin{verbatim}
36 wxDebugReport report;
37 wxDebugReportPreviewStd preview;
38
39 report.AddCurrentContext(); // could also use AddAll()
802fa226 40 report.AddCurrentDump(); // to do both at once
4e0e7d39
VZ
41
42 if ( preview.Show(report) )
43 report.Process();
44\end{verbatim}
45
46\wxheading{Derived from}
47
48No base class
49
50\wxheading{Include files}
51
52<wx/debugrpt.h>
53
54\wxheading{Data structures}
55
802fa226 56This enum is used for functions that report either the current state
4e0e7d39 57or the state during the last (fatal) exception:
802fa226 58
4e0e7d39
VZ
59\begin{verbatim}
60enum wxDebugReport::Context
61{
e586908a 62 Context_Current,
4e0e7d39
VZ
63 Context_Exception
64};
65\end{verbatim}
66
67\latexignore{\rtfignore{\wxheading{Members}}}
68
69
70\membersection{wxDebugReport::wxDebugReport}\label{wxdebugreportwxdebugreport}
71
72\func{}{wxDebugReport}{\void}
73
802fa226 74The constructor creates a temporary directory where the files that will
4e0e7d39
VZ
75be included in the report are created. Use
76\helpref{IsOk()}{wxdebugreportisok} to check for errors.
77
78
79\membersection{wxDebugReport::\destruct{wxDebugReport}}\label{wxdebugreportdtor}
80
81\func{}{\destruct{wxDebugReport}}{\void}
82
802fa226
JS
83The destructor normally destroys the temporary directory created in the constructor
84with all the files it contains. Call \helpref{Reset()}{wxdebugreportreset} to
4e0e7d39
VZ
85prevent this from happening.
86
87
88\membersection{wxDebugReport::AddAll}\label{wxdebugreportaddall}
89
90\func{void}{AddAll}{\param{Context }{context = Context\_Exception}}
91
802fa226 92Adds all available information to the report. Currently this includes a
4e0e7d39
VZ
93text (XML) file describing the process context and, under Win32, a minidump
94file.
95
96
97\membersection{wxDebugReport::AddContext}\label{wxdebugreportaddcontext}
98
99\func{bool}{AddContext}{\param{Context }{ctx}}
100
101Add an XML file containing the current or exception context and the
102stack trace.
103
104
105\membersection{wxDebugReport::AddCurrentContext}\label{wxdebugreportaddcurrentcontext}
106
107\func{bool}{AddCurrentContext}{\void}
108
802fa226 109The same as \helpref{AddContext(Context\_Current)}{wxdebugreportaddcontext}.
4e0e7d39
VZ
110
111
112\membersection{wxDebugReport::AddCurrentDump}\label{wxdebugreportaddcurrentdump}
113
114\func{bool}{AddCurrentDump}{\void}
115
802fa226 116The same as \helpref{AddDump(Context\_Current)}{wxdebugreportadddump}.
4e0e7d39
VZ
117
118
119\membersection{wxDebugReport::AddDump}\label{wxdebugreportadddump}
120
121\func{bool}{AddDump}{\param{Context }{ctx}}
122
802fa226 123Adds the minidump file to the debug report.
4e0e7d39 124
802fa226 125Minidumps are only available under recent Win32 versions (\texttt{dbghlp32.dll}
4e0e7d39
VZ
126can be installed under older systems to make minidumps available).
127
128
129\membersection{wxDebugReport::AddExceptionContext}\label{wxdebugreportaddexceptioncontext}
130
131\func{bool}{AddExceptionContext}{\void}
132
802fa226 133The same as \helpref{AddContext(Context\_Exception)}{wxdebugreportaddcontext}.
4e0e7d39
VZ
134
135
136\membersection{wxDebugReport::AddExceptionDump}\label{wxdebugreportaddexceptiondump}
137
138\func{bool}{AddExceptionDump}{\void}
139
802fa226 140The same as \helpref{AddDump(Context\_Exception)}{wxdebugreportadddump}.
4e0e7d39
VZ
141
142
143\membersection{wxDebugReport::AddFile}\label{wxdebugreportaddfile}
144
145\func{void}{AddFile}{\param{const wxString\& }{name}, \param{const wxString\& }{description}}
146
147Add another file to the report: the file must already exist on disk. Its name
148is relative to \helpref{GetDirectory()}{wxdebugreportgetdirectory}.
149
150\arg{description} only exists to be shown to the user in the report summary
151shown by \helpref{wxDebugReportPreview}{wxdebugreportpreview}.
152
153
154\membersection{wxDebugReport::DoAddCustomContext}\label{wxdebugreportdoaddcustomcontext}
155
156\func{void}{DoAddCustomContext}{\param{wxXmlNode * }{nodeRoot}}
157
158This function may be overridden to add arbitrary custom context to the XML
159context file created by \helpref{AddContext}{wxdebugreportaddcontext}. By
160default, it does nothing.
161
162
163\membersection{wxDebugReport::DoAddExceptionInfo}\label{wxdebugreportdoaddexceptioninfo}
164
165\func{bool}{DoAddExceptionInfo}{\param{wxXmlNode* }{nodeContext}}
166
167This function may be overridden to modify the contents of the exception tag in
168the XML context file.
169
170
171\membersection{wxDebugReport::DoAddLoadedModules}\label{wxdebugreportdoaddloadedmodules}
172
173\func{bool}{DoAddLoadedModules}{\param{wxXmlNode* }{nodeModules}}
174
175This function may be overridden to modify the contents of the modules tag in
176the XML context file.
177
178
179\membersection{wxDebugReport::DoAddSystemInfo}\label{wxdebugreportdoaddsysteminfo}
180
181\func{bool}{DoAddSystemInfo}{\param{wxXmlNode* }{nodeSystemInfo}}
182
183This function may be overridden to modify the contents of the system tag in
184the XML context file.
185
186
187\membersection{wxDebugReport::GetDirectory}\label{wxdebugreportgetdirectory}
188
189\constfunc{const wxString\&}{GetDirectory}{\void}
190
802fa226 191Returns the name of the temporary directory used for the files in this report.
4e0e7d39
VZ
192
193This method should be used to construct the full name of the files which you
194wish to add to the report using \helpref{AddFile}{wxdebugreportaddfile}.
195
196
197\membersection{wxDebugReport::GetFile}\label{wxdebugreportgetfile}
198
199\constfunc{bool}{GetFile}{\param{size\_t }{n}, \param{wxString* }{name}, \param{wxString* }{desc}}
200
802fa226 201Retrieves the name (relative to
4e0e7d39
VZ
202\helpref{GetDirectory()}{wxdebugreportgetdirectory}) and the description of the
203file with the given index. If \arg{n} is greater than or equal to the number of
204filse, \false is returned.
205
206
207\membersection{wxDebugReport::GetFilesCount}\label{wxdebugreportgetfilescount}
208
209\constfunc{size\_t}{GetFilesCount}{\void}
210
802fa226 211Gets the current number files in this report.
4e0e7d39
VZ
212
213
214\membersection{wxDebugReport::GetReportName}\label{wxdebugreportgetreportname}
215
216\constfunc{wxString}{GetReportName}{\void}
217
802fa226 218Gets the name used as a base name for various files, by default
e586908a 219\helpref{wxApp::GetAppName()}{wxappgetappname} is used.
4e0e7d39
VZ
220
221
222\membersection{wxDebugReport::IsOk}\label{wxdebugreportisok}
223
224\constfunc{bool}{IsOk}{\void}
225
802fa226 226Returns \true if the object was successfully initialized. If this method returns
4e0e7d39
VZ
227\false the report can't be used.
228
229
230\membersection{wxDebugReport::Process}\label{wxdebugreportprocess}
231
232\func{bool}{Process}{\void}
233
802fa226
JS
234Processes this report: the base class simply notifies the user that the
235report has been generated. This is usually not enough -- instead you
4e0e7d39
VZ
236should override this method to do something more useful to you.
237
238
239\membersection{wxDebugReport::RemoveFile}\label{wxdebugreportremovefile}
240
241\func{void}{RemoveFile}{\param{const wxString\& }{name}}
242
802fa226 243Removes the file from report: this is used by
4e0e7d39
VZ
244\helpref{wxDebugReportPreview}{wxdebugreportpreview} to allow the user to
245remove files potentially containing private information from the report.
246
247
248\membersection{wxDebugReport::Reset}\label{wxdebugreportreset}
249
250\func{void}{Reset}{\void}
251
802fa226
JS
252Resets the directory name we use. The object can't be used any more after
253this as it becomes uninitialized and invalid.
4e0e7d39 254