blob: 1669a69a4a5543af4191e821839a3e1822d4bdd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include "uptr.h"
#include <execinfo.h>
#include <boost/assert.hpp>
#include <string>
#include <stdlib.h>
#include <exception>
namespace MirrorSearch {
std::string
failingFunction(void * const func)
{
char ** fn = backtrace_symbols(&func, 1);
BOOST_ASSERT(fn);
BOOST_ASSERT(*fn);
std::string funcName(*fn);
free(fn);
return funcName;
}
void
defaultErrorHandler(const std::string & fn)
{
throw std::runtime_error("Fatal error in " + fn);
}
}
|