[mlpack-git] master: Add mlpack::backtrace info. (aa35528)

gitdub at mlpack.org gitdub at mlpack.org
Thu Feb 25 10:35:51 EST 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/fd84f3a2e53592d723a8e8a76dadb8aa76820913...1a9c41a86be1fa1dcc5c3b90dd959c2255c3bb8e

>---------------------------------------------------------------

commit aa355284259a133438bb87ce9d108275ad372652
Author: Grzegorz Krajewski <krajekg at gmail.com>
Date:   Thu Feb 25 16:35:51 2016 +0100

    Add mlpack::backtrace info.
    
    Add note about printing a backtrace.


>---------------------------------------------------------------

aa355284259a133438bb87ce9d108275ad372652
 doc/guide/iodoc.hpp | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/doc/guide/iodoc.hpp b/doc/guide/iodoc.hpp
index 8e32005..9ae1a94 100644
--- a/doc/guide/iodoc.hpp
+++ b/doc/guide/iodoc.hpp
@@ -23,7 +23,8 @@ Output to Log::Debug does not show (and has no performance penalty) when mlpack
 is compiled without debugging symbols.  Output to Log::Info is only shown when
 the program is run with the --verbose (or -v) flag.  Log::Warn is always shown,
 and Log::Fatal will throw a std::runtime_error exception, when a newline is sent
-to it.
+to it only. If mlpack was compiled with debugging symbols, Log::Fatal will
+always throw a std::runtime_error exception and print backtrace.
 
 Here is a simple example, and its output:
 
@@ -48,13 +49,28 @@ int main(int argc, char** argv)
 }
 @endcode
 
-With debugging output and --verbose, the following is shown:
+With debugging output--verbose, the following is shown:
 
 @code
-$ ./main --verbose
 [DEBUG] Compiled with debugging symbols.
 [INFO ] Some test informational output.
 [WARN ] A warning!
+[FATAL] [bt]: (1) /absolute/path/to/file/example.cpp:main:6
+[FATAL] Program has crashed.
+terminate called after throwing an instance of 'std::runtime_error'
+  what():  fatal error; see Log::Fatal output
+Aborted
+ at endcode
+
+With debugging output, compilation flags -g -rdynamic and --verbose,
+the following is shown:
+
+ at code
+[DEBUG] Compiled with debugging symbols.
+[INFO ] Some test informational output.
+[WARN ] A warning!
+[FATAL] Cannot give backtrace because program was compiled without: -g -rdynamic
+[FATAL] For a backtrace, recompile with: -g -rdynamic.
 [FATAL] Program has crashed.
 terminate called after throwing an instance of 'std::runtime_error'
   what():  fatal error; see Log::Fatal output




More information about the mlpack-git mailing list