|
ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
|
#include <bug.h>
Public Member Functions | |
| Debugger (const char *exec=nullptr) | |
| Programmatic construction of Debugger. | |
| virtual | ~Debugger () |
| virtual void | debug (const char *reason) |
| virtual void | traceback (const char *reason) |
| virtual void | set_debug_on_signal (int) |
| Turn on or off debugging on a signel. The default is on. | |
| 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. | |
| virtual void | set_wait_for_debugger (int) |
| virtual void | handle (int sig) |
The Debugger will be activated when sig is caught. | |
| virtual void | release (int sig) |
Reverts the effect of handle(sig) , i.e. the Debugger will not be activated when sig is caught. | |
| virtual void | handle_defaults () |
| This calls handle(int) with all of the major signals. | |
| virtual void | set_prefix (const char *p) |
| This sets a prefix which preceeds all messages printing by Debugger. | |
| virtual void | set_prefix (int p) |
| Set the prefix to the decimal represention of p followed by a ": ". | |
| virtual void | set_cmd (const char *) |
| virtual void | default_cmd () |
| Calls set_cmd with a hopefully suitable default. | |
| virtual void | set_exec (const char *) |
| virtual void | got_signal (int sig) |
| Called when signal sig is received. This is mainly for internal use. | |
Static Public Member Functions | |
| static void | set_default_debugger (const std::shared_ptr< Debugger > &) |
| Set the global default debugger. The initial value is null. | |
| static std::shared_ptr< Debugger > | default_debugger () |
| Return the global default debugger. | |
Protected Member Functions | |
| void | init () |
Static Protected Member Functions | |
| static void | __traceback (const std::string &prefix, const char *reason=nullptr) |
Protected Attributes | |
| std::string | prefix_ |
| std::string | exec_ |
| std::string | cmd_ |
| volatile int | debugger_ready_ |
| bool | debug_ |
| bool | traceback_ |
| bool | exit_on_signal_ |
| bool | sleep_ |
| bool | wait_for_debugger_ |
| bool | handle_sigint_ |
| int * | mysigs_ |
Static Protected Attributes | |
| static std::shared_ptr< Debugger > | default_debugger_ |
The Debugger class describes what should be done when a catastrophic error causes unexpected program termination. It can try things such as start a debugger running where the program died or it can attempt to produce a stack traceback showing roughly where the program died. These attempts will not always succeed.
|
explicit |
|
staticprotected |
prints out a backtrace to std::cout
| prefix | this string will be prepended at the beginning of each line of Backtrace |
| reason | optional string specifying the reason for traceback |
Definition at line 415 of file bug.cpp.
|
virtual |
|
virtual |
|
static |
|
virtual |
|
virtual |
|
virtual |
This calls handle(int) with all of the major signals.
Definition at line 220 of file bug.cpp.
|
protected |
|
virtual |
|
virtual |
Sets the command to be executed when debug is called. The character sequence "$(EXEC)" is replaced by the executable name (see set_exec), "$(PID)" is replaced by the current process id, and "$(PREFIX)" is replaced by the prefix.
Definition at line 290 of file bug.cpp.
|
virtual |
|
static |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
The traceback member attempts to produce a Backtrace for the current process. A symbol table must be saved for the executable if any sense is to be made of the traceback. This feature is available on platforms with (1) libunwind, (2) backtrace, or (3) certain platforms with hardwired unwinding.
| reason | optional string specifying the reason for traceback |
Definition at line 413 of file bug.cpp.
|
staticprotected |
1.9.8