All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ana::InstallHandlers Class Reference

Public Member Functions

 InstallHandlers ()
 

Detailed Description

Definition at line 52 of file DebugHelpers.cxx.

Constructor & Destructor Documentation

ana::InstallHandlers::InstallHandlers ( )
inline

Definition at line 55 of file DebugHelpers.cxx.

56  {
57  // We're already being debugged somehow. Don't complicate things
58  if(getenv("CAFE_NO_BACKTRACE")) return;
59 
60  // Check that this is really a CAFAna job. Somehow this library gets
61  // loaded into art jobs too??
62  char s[1024];
63  sprintf(s, "/proc/%d/cmdline", getpid());
64  std::ifstream f(s);
65  if(f){
66  std::string ss;
67  f >> ss;
68  if(ss.find("root.exe") == std::string::npos) return;
69  }
70 
71  // Handle uncaught exceptions
72  std::set_terminate(handle_terminate);
73 
74  // Handle abort(), segfaults, bus errors, and FPEs
75  struct sigaction sa;
76  memset(&sa, 0, sizeof(sa));
77  sigemptyset(&sa.sa_mask);
78 
79  sa.sa_sigaction = handle_signal;
80  sa.sa_flags = SA_SIGINFO;
81 
82  sigaction(SIGABRT, &sa, NULL);
83  sigaction(SIGSEGV, &sa, NULL);
84  sigaction(SIGBUS, &sa, NULL);
85  sigaction(SIGFPE, &sa, NULL);
86  }
void handle_terminate()
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
void handle_signal(int sig, siginfo_t *, void *)

The documentation for this class was generated from the following file: