ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
SealDebug.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
20
21
#ifndef CXXUTILS_SEAL_DEBUG_H
// wlav SEAL_BASE_DEBUG_H
22
#define CXXUTILS_SEAL_DEBUG_H
// wlav SEAL_BASE_DEBUG_H
23
24
#include "
CxxUtils/checker_macros.h
"
25
#include "
CxxUtils/SealCommon.h
"
// sss -- needed for IOFD
26
# include <cstddef>
27
# include <atomic>
28
29
// wlav copied from SealBase/sysapi/DebugAids.h
30
// Windows doesn't have this, so fake a suitable substitute
31
# ifdef _WIN32
32
# define STDERR_HANDLE GetStdHandle (STD_ERROR_HANDLE)
33
# else
34
# define STDERR_HANDLE STDERR_FILENO
35
# endif
36
37
// Define a suitable wrapper to write to system file descriptors.
38
// This is needed because on Windows we are using HANDLEs, not the
39
// compiler's crippled posixy interface.
40
# ifdef _WIN32
41
# define MYWRITE(fd,data,n) do { DWORD written; WriteFile(fd,data,n,\
42
&written,0); } while (0)
43
# else
44
# define MYWRITE(fd,data,n) write(fd,data,n)
45
# endif
46
47
48
namespace
Athena
{
// wlav
49
50
51
// wlav copied from SealBase/BitTraits.h
53
template
<
class
T>
54
struct
BitTraits
55
{
57
enum
{
Bits
=
sizeof
(T) * CHAR_BIT };
58
60
enum
{
Bytes
=
Bits
/ 8 + ((
Bits
% 8) > 0) };
61
63
enum
{
Digits
= (
Bits
* 30103) / 100000 + 1 };
64
// 30103 =~ M_LN2 / M_LN10 * 100000
65
67
enum
{
HexDigits
=
Bits
/ 4 + ((
Bits
% 4) > 0) };
68
};
69
70
72
class
DebugAids
73
{
74
public
:
75
// Miscellaneous functions
76
static
IOFD
stacktraceFd
(
IOFD
fd =
IOFD_INVALID
);
77
static
void
stacktrace
ATLAS_NOT_THREAD_SAFE
(
IOFD
fd =
IOFD_INVALID
);
78
static
void
coredump
(
int
sig, ...);
79
// sss
80
static
void
stacktraceLine
ATLAS_NOT_THREAD_SAFE
(
IOFD
fd,
81
unsigned
long
addr);
82
static
void
setStackTraceAddr2Line
ATLAS_NOT_THREAD_SAFE
(
const
char
* path);
83
84
// fwinkl
85
static
unsigned
long
enableCoreFiles
();
86
static
void
disableCoreFiles
();
87
private
:
88
static
std::atomic<IOFD>
s_stackTraceFd
;
89
};
90
91
92
}
// namespace Athena wlav
93
#endif
// CXXUTILS_SEAL_DEBUG_H wlav SEAL_BASE_DEBUG_H
SealCommon.h
Collecting a few shared bits and pieces from SEAL headers.
IOFD_INVALID
#define IOFD_INVALID
Invalid channel descriptor constant.
Definition
SealCommon.h:20
IOFD
int IOFD
Type the system uses for channel descriptors.
Definition
SealCommon.h:27
checker_macros.h
Define macros for attributes used to control the static checker.
DebugAids
Utilities for debugging support.
Definition
SealDebug.h:73
DebugAids::ATLAS_NOT_THREAD_SAFE
static void setStackTraceAddr2Line ATLAS_NOT_THREAD_SAFE(const char *path)
DebugAids::coredump
static void coredump(int sig,...)
Drop a core dump and continue.
Definition
SealDebug.cxx:974
DebugAids::disableCoreFiles
static void disableCoreFiles()
Disable core dump files by setting the soft limit to 0.
Definition
SealDebug.cxx:1050
DebugAids::stacktraceFd
static IOFD stacktraceFd(IOFD fd=IOFD_INVALID)
Set and return the file descriptor for stack trace output.
Definition
SealDebug.cxx:607
DebugAids::enableCoreFiles
static unsigned long enableCoreFiles()
Try to enable core dump files by raising the soft size limit to the hard limit.
Definition
SealDebug.cxx:1030
DebugAids::ATLAS_NOT_THREAD_SAFE
static void stacktrace ATLAS_NOT_THREAD_SAFE(IOFD fd=IOFD_INVALID)
DebugAids::s_stackTraceFd
static std::atomic< IOFD > s_stackTraceFd
Definition
SealDebug.h:88
DebugAids::ATLAS_NOT_THREAD_SAFE
static void stacktraceLine ATLAS_NOT_THREAD_SAFE(IOFD fd, unsigned long addr)
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
BitTraits
Definition
SealDebug.h:55
BitTraits::HexDigits
@ HexDigits
Definition
SealDebug.h:67
BitTraits::Bytes
@ Bytes
Definition
SealDebug.h:60
BitTraits::Digits
@ Digits
Definition
SealDebug.h:63
BitTraits::Bits
@ Bits
Definition
SealDebug.h:57
Generated on
for ATLAS Offline Software by
1.17.0