mlpack 3.4.2
Classes | Public Member Functions | List of all members
Backtrace Class Reference

Provides a backtrace. More...

#include <backtrace.hpp>

Public Member Functions

 Backtrace ()
 Constructor initialize fields and call GetAddress to retrieve addresses for each frame of backtrace. More...
 
std::string ToString ()
 Returns string of backtrace. More...
 

Detailed Description

Provides a backtrace.

The Backtrace class retrieve addresses of each called function from the stack and decode file name, function & line number. Retrieved information can be printed in form:

[b]: (count) /directory/to/file.cpp:function(args):line_number

Backtrace is printed always when Log::Assert failed. An example is given below.

if (!someImportantCondition())
{
Log::Fatal << "someImportantCondition() is not satisfied! Terminating.";
Log::Fatal << std::endl;
}
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
Definition: log.hpp:90
Note
Log::Assert will not be shown when compiling in non-debug mode.
See also
PrefixedOutStream, Log

Definition at line 46 of file backtrace.hpp.

Constructor & Destructor Documentation

◆ Backtrace()

Backtrace ( )

Constructor initialize fields and call GetAddress to retrieve addresses for each frame of backtrace.

Member Function Documentation

◆ ToString()

std::string ToString ( )

Returns string of backtrace.


The documentation for this class was generated from the following file: