]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/debugrpt.tex
Eliminate warning on WinCE
[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
19wxDebugReport contains one or more files. A few of them can be created by the
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
24Once report is fully assembled, it can be simply left in the temporary
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
29to accept uploads is your responsibility, of course). Other handlers, e.g. for
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()
40 report.AddCurrentDump(); // to do both at once
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
56This enum used for the functions which may report either the current state
57or the state during the last (fatal) exception:
58\begin{verbatim}
59enum wxDebugReport::Context
60{
e586908a 61 Context_Current,
4e0e7d39
VZ
62 Context_Exception
63};
64\end{verbatim}
65
66\latexignore{\rtfignore{\wxheading{Members}}}
67
68
69\membersection{wxDebugReport::wxDebugReport}\label{wxdebugreportwxdebugreport}
70
71\func{}{wxDebugReport}{\void}
72
73Constructor creates a temporary directory where the files which will
74be included in the report are created. Use
75\helpref{IsOk()}{wxdebugreportisok} to check for errors.
76
77
78\membersection{wxDebugReport::\destruct{wxDebugReport}}\label{wxdebugreportdtor}
79
80\func{}{\destruct{wxDebugReport}}{\void}
81
82Destructor normally destroys the temporary directory created in the constructor
83with all the files it contains, call \helpref{Reset()}{wxdebugreportreset} to
84prevent this from happening.
85
86
87\membersection{wxDebugReport::AddAll}\label{wxdebugreportaddall}
88
89\func{void}{AddAll}{\param{Context }{context = Context\_Exception}}
90
91Add all available information to the report. Currently this includes a
92text (XML) file describing the process context and, under Win32, a minidump
93file.
94
95
96\membersection{wxDebugReport::AddContext}\label{wxdebugreportaddcontext}
97
98\func{bool}{AddContext}{\param{Context }{ctx}}
99
100Add an XML file containing the current or exception context and the
101stack trace.
102
103
104\membersection{wxDebugReport::AddCurrentContext}\label{wxdebugreportaddcurrentcontext}
105
106\func{bool}{AddCurrentContext}{\void}
107
108Same as \helpref{AddContext(Context\_Current)}{wxdebugreportaddcontext}.
109
110
111\membersection{wxDebugReport::AddCurrentDump}\label{wxdebugreportaddcurrentdump}
112
113\func{bool}{AddCurrentDump}{\void}
114
115Same as \helpref{AddDump(Context\_Current)}{wxdebugreportadddump}.
116
117
118\membersection{wxDebugReport::AddDump}\label{wxdebugreportadddump}
119
120\func{bool}{AddDump}{\param{Context }{ctx}}
121
122Adds minidump file to the debug report.
123
124Minidumps are only available under recent Win32 versions (\texttt{dbghlp32.dll}
125can be installed under older systems to make minidumps available).
126
127
128\membersection{wxDebugReport::AddExceptionContext}\label{wxdebugreportaddexceptioncontext}
129
130\func{bool}{AddExceptionContext}{\void}
131
132Same as \helpref{AddContext(Context\_Exception)}{wxdebugreportaddcontext}.
133
134
135\membersection{wxDebugReport::AddExceptionDump}\label{wxdebugreportaddexceptiondump}
136
137\func{bool}{AddExceptionDump}{\void}
138
139Same as \helpref{AddDump(Context\_Exception)}{wxdebugreportadddump}.
140
141
142\membersection{wxDebugReport::AddFile}\label{wxdebugreportaddfile}
143
144\func{void}{AddFile}{\param{const wxString\& }{name}, \param{const wxString\& }{description}}
145
146Add another file to the report: the file must already exist on disk. Its name
147is relative to \helpref{GetDirectory()}{wxdebugreportgetdirectory}.
148
149\arg{description} only exists to be shown to the user in the report summary
150shown by \helpref{wxDebugReportPreview}{wxdebugreportpreview}.
151
152
153\membersection{wxDebugReport::DoAddCustomContext}\label{wxdebugreportdoaddcustomcontext}
154
155\func{void}{DoAddCustomContext}{\param{wxXmlNode * }{nodeRoot}}
156
157This function may be overridden to add arbitrary custom context to the XML
158context file created by \helpref{AddContext}{wxdebugreportaddcontext}. By
159default, it does nothing.
160
161
162\membersection{wxDebugReport::DoAddExceptionInfo}\label{wxdebugreportdoaddexceptioninfo}
163
164\func{bool}{DoAddExceptionInfo}{\param{wxXmlNode* }{nodeContext}}
165
166This function may be overridden to modify the contents of the exception tag in
167the XML context file.
168
169
170\membersection{wxDebugReport::DoAddLoadedModules}\label{wxdebugreportdoaddloadedmodules}
171
172\func{bool}{DoAddLoadedModules}{\param{wxXmlNode* }{nodeModules}}
173
174This function may be overridden to modify the contents of the modules tag in
175the XML context file.
176
177
178\membersection{wxDebugReport::DoAddSystemInfo}\label{wxdebugreportdoaddsysteminfo}
179
180\func{bool}{DoAddSystemInfo}{\param{wxXmlNode* }{nodeSystemInfo}}
181
182This function may be overridden to modify the contents of the system tag in
183the XML context file.
184
185
186\membersection{wxDebugReport::GetDirectory}\label{wxdebugreportgetdirectory}
187
188\constfunc{const wxString\&}{GetDirectory}{\void}
189
190Return the name of the temporary directory used for the files in this report.
191
192This method should be used to construct the full name of the files which you
193wish to add to the report using \helpref{AddFile}{wxdebugreportaddfile}.
194
195
196\membersection{wxDebugReport::GetFile}\label{wxdebugreportgetfile}
197
198\constfunc{bool}{GetFile}{\param{size\_t }{n}, \param{wxString* }{name}, \param{wxString* }{desc}}
199
200Retrieve the name (relative to
201\helpref{GetDirectory()}{wxdebugreportgetdirectory}) and the description of the
202file with the given index. If \arg{n} is greater than or equal to the number of
203filse, \false is returned.
204
205
206\membersection{wxDebugReport::GetFilesCount}\label{wxdebugreportgetfilescount}
207
208\constfunc{size\_t}{GetFilesCount}{\void}
209
210Get the current number files in this report.
211
212
213\membersection{wxDebugReport::GetReportName}\label{wxdebugreportgetreportname}
214
215\constfunc{wxString}{GetReportName}{\void}
216
217Get the name used as base name for various files, by default
e586908a 218\helpref{wxApp::GetAppName()}{wxappgetappname} is used.
4e0e7d39
VZ
219
220
221\membersection{wxDebugReport::IsOk}\label{wxdebugreportisok}
222
223\constfunc{bool}{IsOk}{\void}
224
225Return \true if the object was successfully initialized, if this method returns
226\false the report can't be used.
227
228
229\membersection{wxDebugReport::Process}\label{wxdebugreportprocess}
230
231\func{bool}{Process}{\void}
232
233Process this report: the base class simply notifies the user that the
234report has been generated, this is usually not enough -- instead you
235should override this method to do something more useful to you.
236
237
238\membersection{wxDebugReport::RemoveFile}\label{wxdebugreportremovefile}
239
240\func{void}{RemoveFile}{\param{const wxString\& }{name}}
241
242Remove the file from report: this is used by
243\helpref{wxDebugReportPreview}{wxdebugreportpreview} to allow the user to
244remove files potentially containing private information from the report.
245
246
247\membersection{wxDebugReport::Reset}\label{wxdebugreportreset}
248
249\func{void}{Reset}{\void}
250
251Reset the directory name we use, the object can't be used any more after
252this as it becomes invalid/uninitialized.
253