28 #ifndef _util_misc_bug_h
29 #define _util_misc_bug_h
33 #include <util/class/class.h>
34 #include <util/state/state.h>
35 #include <util/ref/ref.h>
51 volatile int debugger_ready_;
57 int wait_for_debugger_;
71 static void __traceback(
const std::string& prefix,
const char *reason = 0);
128 Backtrace(
const std::string& prefix = std::string(
""));
135 return frames_.empty();
143 std::string
str(
const size_t nframes_to_skip = 0)
const;
147 std::vector<std::string> frames_;
152 static std::string __demangle(
const std::string& symbol);
157 virtual void debug(
const char *reason = 0);
165 virtual void traceback(
const char *reason = 0);
178 virtual void handle(
int sig);
192 virtual void set_cmd(
const char *);
198 virtual void set_exec(
const char *);
Creates a backtrace of a running program/thread.
Definition: bug.h:123
virtual void set_cmd(const char *)
Sets the command to be exectuted when debug is called.
virtual void set_prefix(const char *p)
This sets a prefix which preceeds all messages printing by Debugger.
A template class that maintains references counts.
Definition: ref.h:361
static void set_default_debugger(const Ref< Debugger > &)
Set the global default debugger. The initial value is null.
virtual void handle_defaults()
This calls handle(int) with all of the major signals.
virtual void traceback(const char *reason=0)
The traceback member attempts to produce a Backtrace for the current process.
std::string str(const size_t nframes_to_skip=0) const
converts to a string
The Debugger class describes what should be done when a catastrophic error causes unexpected program ...
Definition: bug.h:46
virtual void set_exec(const char *)
Set the name of the exectuble for the current process.
virtual void debug(const char *reason=0)
The debug member attempts to start a debugger running on the current process.
virtual void default_cmd()
Calls set_cmd with a hopefully suitable default.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
bool empty() const
Definition: bug.h:134
Definition: stateout.h:71
static void __traceback(const std::string &prefix, const char *reason=0)
prints out a backtrace
virtual void set_wait_for_debugger(int)
Turn on or off running an infinite loop after the debugger is started.
Backtrace(const std::string &prefix=std::string(""))
virtual void set_debug_on_signal(int)
Turn on or off debugging on a signel. The default is on.
virtual void handle(int sig)
The Debugger will be actived when sig is caught.
Base class for objects that can save/restore state.
Definition: state.h:45
static Debugger * default_debugger()
Return the global default debugger.
virtual void got_signal(int sig)
Called when signal sig is received. This is mainly for internal use.
virtual void set_traceback_on_signal(int)
Turn on or off traceback on a signel. The default is on.
virtual void set_exit_on_signal(int)
Turn on or off exit after a signel. The default is on.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:24:01 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.