File: classwx_stack_walker.html

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (238 lines) | stat: -rw-r--r-- 16,512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxStackWalker Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
 <tbody>
 <tr>
  <td id="projectlogo">
    <a href="http://www.wxwidgets.org/" target="_new">
      <img alt="wxWidgets" src="logo.png"/>
    </a>
  </td>
  <td style="padding-left: 0.5em; text-align: right;">
   <span id="projectnumber">Version: 3.0.2</span>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Categories</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classwx_stack_walker-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">wxStackWalker Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__group__class__debugging.html">Debugging</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;wx/stackwalk.h&gt;</code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classwx_stack_walker.html" title="wxStackWalker allows an application to enumerate, or walk, the stack frames (the function callstack)...">wxStackWalker</a> allows an application to enumerate, or walk, the stack frames (the function callstack). </p>
<p>It is mostly useful in only two situations: inside <a class="el" href="classwx_app_console.html#a927931aafbb7aec4debdfc02ee6f6f9d" title="This function may be called if something fatal happens: an unhandled exception under Win32 or a fatal...">wxApp::OnFatalException</a> function to programmatically get the location of the crash and, in debug builds, in <a class="el" href="classwx_app_console.html#a5f91d78bbfe3c9ef28e8e3c8fdf29989" title="This function is called when an assert failure occurs, i.e. the condition specified in wxASSERT() mac...">wxApp::OnAssertFailure</a> to report the caller of the failed assert.</p>
<p><a class="el" href="classwx_stack_walker.html" title="wxStackWalker allows an application to enumerate, or walk, the stack frames (the function callstack)...">wxStackWalker</a> works by repeatedly calling the <a class="el" href="classwx_stack_walker.html#a3ba4c8fec5ecc40e9981fe9d21267e11" title="This function must be overidden to process the given frame.">wxStackWalker::OnStackFrame</a> method for each frame in the stack, so to use it you must derive your own class from it and override this method.</p>
<p>This class will not return anything except raw stack frame addresses if the debug information is not available. Under Win32 this means that the PDB file matching the program being executed should be present. Note that if you use Microsoft Visual C++ compiler, you can create PDB files even for the programs built in release mode and it doesn't affect the program size (at least if you don't forget to add <code>/opt</code>:ref option which is suppressed by using <code>/debug</code> linker option by default but should be always enabled for release builds). Under Unix, you need to compile your program with debugging information (usually using <code>-g</code> compiler and linker options) to get the file and line numbers information, however function names should be available even without it. Of course, all this is only <span class="literal">true</span> if you build using a recent enough version of GNU libc which provides the <code>backtrace()</code> function needed to walk the stack.</p>
<p>See <a class="el" href="overview_debugging.html">Debugging</a> for how to make it available.</p>
<h2></h2>
<div><span class="lib">Library:</span>&#160;&#160;<span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>&#160;&#160;<span class="category_text"><a class="el" href="group__group__class__debugging.html">Debugging</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_stack_frame.html" title="wxStackFrame represents a single stack frame, or a single function in the call stack, and is used exclusively together with wxStackWalker, see there for a more detailed discussion.">wxStackFrame</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab4d72a86c8635c0b0dd7e956999d63fa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_stack_walker.html#ab4d72a86c8635c0b0dd7e956999d63fa">wxStackWalker</a> (const char *argv0=NULL)</td></tr>
<tr class="memdesc:ab4d72a86c8635c0b0dd7e956999d63fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor does nothing, use <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> to walk the stack.  <a href="#ab4d72a86c8635c0b0dd7e956999d63fa"></a><br/></td></tr>
<tr class="separator:ab4d72a86c8635c0b0dd7e956999d63fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8e0dd864e72e8916c6c7fa03edfff6c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_stack_walker.html#ad8e0dd864e72e8916c6c7fa03edfff6c">~wxStackWalker</a> ()</td></tr>
<tr class="memdesc:ad8e0dd864e72e8916c6c7fa03edfff6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor does nothing neither but should be virtual as this class is used as a base one.  <a href="#ad8e0dd864e72e8916c6c7fa03edfff6c"></a><br/></td></tr>
<tr class="separator:ad8e0dd864e72e8916c6c7fa03edfff6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ffc3da14b164f25629484d654fd658e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e">Walk</a> (size_t skip=1, size_t maxDepth=<a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb">wxSTACKWALKER_MAX_DEPTH</a>)</td></tr>
<tr class="memdesc:a0ffc3da14b164f25629484d654fd658e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumerate stack frames from the current location, skipping the initial number of them (this can be useful when <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> is called from some known location and you don't want to see the first few frames anyhow; also notice that <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> frame itself is not included if skip = 1).  <a href="#a0ffc3da14b164f25629484d654fd658e"></a><br/></td></tr>
<tr class="separator:a0ffc3da14b164f25629484d654fd658e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0070ec65cf71e26cbd9479b558d8769"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_stack_walker.html#ab0070ec65cf71e26cbd9479b558d8769">WalkFromException</a> (size_t maxDepth=<a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb">wxSTACKWALKER_MAX_DEPTH</a>)</td></tr>
<tr class="memdesc:ab0070ec65cf71e26cbd9479b558d8769"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumerate stack frames from the location of uncaught exception.  <a href="#ab0070ec65cf71e26cbd9479b558d8769"></a><br/></td></tr>
<tr class="separator:ab0070ec65cf71e26cbd9479b558d8769"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a3ba4c8fec5ecc40e9981fe9d21267e11"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_stack_walker.html#a3ba4c8fec5ecc40e9981fe9d21267e11">OnStackFrame</a> (const <a class="el" href="classwx_stack_frame.html">wxStackFrame</a> &amp;frame)=0</td></tr>
<tr class="memdesc:a3ba4c8fec5ecc40e9981fe9d21267e11"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function must be overidden to process the given frame.  <a href="#a3ba4c8fec5ecc40e9981fe9d21267e11"></a><br/></td></tr>
<tr class="separator:a3ba4c8fec5ecc40e9981fe9d21267e11"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ab4d72a86c8635c0b0dd7e956999d63fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxStackWalker::wxStackWalker </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>argv0</em> = <code>NULL</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor does nothing, use <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> to walk the stack. </p>

</div>
</div>
<a class="anchor" id="ad8e0dd864e72e8916c6c7fa03edfff6c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual wxStackWalker::~wxStackWalker </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor does nothing neither but should be virtual as this class is used as a base one. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3ba4c8fec5ecc40e9981fe9d21267e11"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void wxStackWalker::OnStackFrame </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_stack_frame.html">wxStackFrame</a> &amp;&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function must be overidden to process the given frame. </p>

</div>
</div>
<a class="anchor" id="a0ffc3da14b164f25629484d654fd658e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void wxStackWalker::Walk </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>skip</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>maxDepth</em> = <code><a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb">wxSTACKWALKER_MAX_DEPTH</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enumerate stack frames from the current location, skipping the initial number of them (this can be useful when <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> is called from some known location and you don't want to see the first few frames anyhow; also notice that <a class="el" href="classwx_stack_walker.html#a0ffc3da14b164f25629484d654fd658e" title="Enumerate stack frames from the current location, skipping the initial number of them (this can be us...">Walk()</a> frame itself is not included if skip = 1). </p>
<p>Up to <em>maxDepth</em> frames are walked from the innermost to the outermost one. It defaults to <a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb" title="This is the default value of the wxStackWalker::Walk function.">wxSTACKWALKER_MAX_DEPTH</a>. </p>

</div>
</div>
<a class="anchor" id="ab0070ec65cf71e26cbd9479b558d8769"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void wxStackWalker::WalkFromException </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>maxDepth</em> = <code><a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb">wxSTACKWALKER_MAX_DEPTH</a></code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enumerate stack frames from the location of uncaught exception. </p>
<p>This method can only be called from <a class="el" href="classwx_app_console.html#a927931aafbb7aec4debdfc02ee6f6f9d" title="This function may be called if something fatal happens: an unhandled exception under Win32 or a fatal...">wxApp::OnFatalException()</a>.</p>
<p>Up to <em>maxDepth</em> frames are walked from the innermost to the outermost one. It defaults to <a class="el" href="stackwalk_8h.html#a3e64ee90baa6b1d271281ea5112e89cb" title="This is the default value of the wxStackWalker::Walk function.">wxSTACKWALKER_MAX_DEPTH</a>. </p>

</div>
</div>
</div><!-- contents -->

<address class="footer">
	<small>
		Generated on Thu Nov 27 2014 13:46:59 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
	</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>