Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

stacktraces.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2019 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef DASH_STACKTRACES_H
6 #define DASH_STACKTRACES_H
7 
8 #include <string>
9 #include <sstream>
10 #include <exception>
11 
12 #include <cxxabi.h>
13 
14 #include <tinyformat.h>
15 
16 std::string DemangleSymbol(const std::string& name);
17 
18 std::string GetPrettyExceptionStr(const std::exception_ptr& e);
19 std::string GetCrashInfoStrFromSerializedStr(const std::string& ciStr);
20 
21 template<typename T>
22 std::string GetExceptionWhat(const T& e);
23 
24 template<>
25 inline std::string GetExceptionWhat(const std::exception& e)
26 {
27  return e.what();
28 }
29 
30 // Default implementation
31 template<typename T>
32 inline std::string GetExceptionWhat(const T& e)
33 {
34  std::ostringstream s;
35  s << e;
36  return s.str();
37 }
38 
41 
42 #endif//DASH_STACKTRACES_H
const char * name
Definition: rest.cpp:36
std::string GetPrettyExceptionStr(const std::exception_ptr &e)
void RegisterPrettyTerminateHander()
std::string DemangleSymbol(const std::string &name)
Definition: stacktraces.cpp:51
std::string GetExceptionWhat(const T &e)
Definition: stacktraces.h:32
std::string GetCrashInfoStrFromSerializedStr(const std::string &ciStr)
void RegisterPrettySignalHandlers()
Released under the MIT license