ATLAS Offline Software
Classes | Namespaces | Typedefs | Functions
exctrace_collector.cxx File Reference

Generate stack trace backs from a caught exception — collector module. More...

#include <dlfcn.h>
#include <execinfo.h>
#include <cstdio>
#include <typeinfo>
#include <utility>
#include <algorithm>
#include <exception>
#include "CxxUtils/checker_macros.h"
Include dependency graph for exctrace_collector.cxx:

Go to the source code of this file.

Classes

struct  CxxUtils::extrace_init
 

Namespaces

 CxxUtils
 

Typedefs

typedef void throwfn(void *, void *, void(*dest) (void *))
 

Functions

void extrace_force_libstd_link ()
 
int exctrace_get_last_trace (int max_depth, void *trace[])
 
void __cxa_throw (void *thrown_exception, void *tinfo, void(*dest)(void *))
 

Detailed Description

Generate stack trace backs from a caught exception — collector module.

Author
scott snyder snyde.nosp@m.r@bn.nosp@m.l.gov
Date
Oct, 2009 When preloaded, this module hooks into the __cxa_throw function used by the abi to throw exceptions so that it records stack back traces in static variables. These can later be accessed with CxxUtils::exctrace.

Definition in file exctrace_collector.cxx.

Typedef Documentation

◆ throwfn

typedef void throwfn(void *, void *, void(*dest)(void *))

Definition at line 36 of file exctrace_collector.cxx.

Function Documentation

◆ __cxa_throw()

void __cxa_throw ( void *  thrown_exception,
void *  tinfo,
void(*)(void *)  dest 
)

Definition at line 63 of file exctrace_collector.cxx.

66 {
67  exctrace_last_depth = backtrace (exctrace_last_trace, bt_depth);
68  old_throw (thrown_exception, tinfo, dest);
69  // not reached
70  std::abort();
71 }

◆ exctrace_get_last_trace()

int exctrace_get_last_trace ( int  max_depth,
void *  trace[] 
)

Definition at line 52 of file exctrace_collector.cxx.

53  {
54  int ncopy = std::min (exctrace_last_depth, max_depth);
55  std::copy (exctrace_last_trace, exctrace_last_trace+ncopy, trace);
56  return ncopy;
57  }

◆ extrace_force_libstd_link()

void extrace_force_libstd_link ( )

Definition at line 43 of file exctrace_collector.cxx.

44 {
45  std::terminate();
46 }
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
calibdata.copy
bool copy
Definition: calibdata.py:27
check_log.backtrace
backtrace
Definition: check_log.py:58