ATLAS Offline Software
|
Utilities for debugging support. More...
#include <SealDebug.h>
Static Public Member Functions | |
static IOFD | stacktraceFd (IOFD fd=IOFD_INVALID) |
Set and return the file descriptor for stack trace output. More... | |
static void stacktrace | ATLAS_NOT_THREAD_SAFE (IOFD fd=IOFD_INVALID) |
static void | coredump (int sig,...) |
Drop a core dump and continue. More... | |
static void stacktraceLine | ATLAS_NOT_THREAD_SAFE (IOFD fd, unsigned long addr) |
static void setStackTraceAddr2Line | ATLAS_NOT_THREAD_SAFE (const char *path) |
static unsigned long | enableCoreFiles () |
Try to enable core dump files by raising the soft size limit to the hard limit. More... | |
static void | disableCoreFiles () |
Disable core dump files by setting the soft limit to 0. More... | |
Static Private Attributes | |
static std::atomic< IOFD > | s_stackTraceFd = IOFD_INVALID |
The default output file descriptor for #stacktrace(). More... | |
|
static |
|
static |
|
static |
|
static |
Drop a core dump and continue.
Creates a core file for the current program state and continues execution. sig should be the number of the signal from which the program should appear to have died; this should a fatal signal that does cause a core file to be created (or SIGUSR1
).
This works by forking the process and then killing the child with the given signal; the signal is automatically unblocked in the child to make sure the sure the signal is delivered. Thus the function returns only once, in the parent process.
This function can be safely installed directly as a signal handler. #Signal::handleFatal() will do so for SIGUSR1
with suitable options.
Note that this function does not change core dump resource limits, not even for the forked child process. If core files are disabled through resource limits, no core file will be created despite your explicit request to create one.
This concept was taken from DDD, the Data Display Debugger.
Definition at line 971 of file SealDebug.cxx.
|
static |
Disable core dump files by setting the soft limit to 0.
This is equivalent to ulimit -Sc 0
in bash.
Definition at line 1047 of file SealDebug.cxx.
|
static |
Try to enable core dump files by raising the soft size limit to the hard limit.
There might be other reason though why the system does not produce core files, so this is only one of the prerequisites.
Returns the currently valid soft size limit.
This is equivalent to using ulimit -Sc
in bash.
Definition at line 1027 of file SealDebug.cxx.
|
static |
Set and return the file descriptor for stack trace output.
If fd is the default invalid descriptor value, returns the current value without changing the setting. This value is only effective for #stacktrace(), but can be overridden by the argument given to that function.
Definition at line 604 of file SealDebug.cxx.
|
staticprivate |