X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a256039a12cb07863c3985f86a869cfb7eb3510e..239ef314528b253ea4ca5946ec2cfcb74bab1866:/docs/latex/wx/stackwalker.tex diff --git a/docs/latex/wx/stackwalker.tex b/docs/latex/wx/stackwalker.tex index 93e12f6432..f1ec17f0ba 100644 --- a/docs/latex/wx/stackwalker.tex +++ b/docs/latex/wx/stackwalker.tex @@ -5,25 +5,37 @@ %% Created: 2005-01-19 %% RCS-ID: $Id$ %% Copyright: (c) 2005 Vadim Zeitlin -%% License: wxWidgets license +%% License: wxWindows license %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\class{wxStackWalker}}\label{wxstackwalker} -wxStackWalker allows to enumerate, or walk, the stack frames or, in other -words, the functions callstack. It is mostly useful in only two situations: +wxStackWalker allows an application to enumerate, or walk, the stack frames (the function callstack). +It is mostly useful in only two situations: inside \helpref{wxApp::OnFatalException}{wxapponfatalexception} function to -programmatically get the location of the crash and, in debug builds, in -\helpref{wxApp::OnAssert}{wxapponassert} to report the caller of the failed +programmatically get the location of the crash and, in debug builds, in +\helpref{wxApp::OnAssertFailure}{wxapponassertfailure} to report the caller of the failed assert. -wxStackWalker works by repeatedly calling -\helpref{OnStackFrame}{wxstackwalkeronstackframe} method for each frame in the +wxStackWalker works by repeatedly calling +the \helpref{OnStackFrame}{wxstackwalkeronstackframe} method for each frame in the stack, so to use it you must derive your own class from it and override this method. This class will not return anything except raw stack frame addresses if the -debug information is not available. See +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 \texttt{/opt:ref} option which is suppressed by using +\texttt{/debug} 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 \texttt{-g} 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 true if you build using a recent +enough version of GNU libc which provides the \texttt{backtrace()} function +needed to walk the stack. + \helpref{debugging overview}{debuggingoverview} for how to make it available. \wxheading{Derived from} @@ -83,6 +95,5 @@ notice that Walk() frame itself is not included if skip $\ge 1$). \func{void}{WalkFromException}{\void} Enumerate stack frames from the location of uncaught exception. -This method can only be called from +This method can only be called from \helpref{wxApp::OnFatalException()}{wxapponfatalexception}. -