28 #include "defines.hpp" 73 if (!pContainer || !trTH)
76 return trTH->
handler->
setup(move(pContainer->
obj)) ==
true ? TR_TRUE : TR_FALSE;
86 memset(&cfg, 0,
sizeof(cfg));
112 for (
size_t i = 0; i < 64 && i < trTH->
cfg.
signums.size(); ++i) {
125 for (
size_t i = 0; i < 8; ++i) {
133 for (
size_t i = 0; i < 8; ++i) {
151 for (
size_t i = 0; i < 64; ++i) {
void tr_freeTracerHandler(tr_TracerHandler_t *trTH)
Frees the handler.
void(* tr_callBackPTR)(void *tracer, void *printer, void *userData)
C user callback for the signal handler.
std::vector< TraceerEngines > preferredTracerEngines
List of preferred engines; First try them for the Tracer.
void setConfig(Config c)
Sets the new configuration.
void tr_TracerHandler__reset()
Wrapper for tracer::TracerHandler::reset.
tr_callBackPTR callback
Function pointer to be called in the internal signal handler (MUST return)
void(* callBackPTR)(Tracer *tracer, AbstractPrinter *printer, void *userData)
The typedef callback for the user.
Internal C wrapper structure.
std::vector< int > signums
List of signals to handle.
bool appendToFile
Overides file co; Requires autoPrintToFile.
std::string logFile
The file to automatically print to; Requires autoPrintToFile.
tr_TracerHandler_t * tr_getTracerHandler()
Retunrns the handler as a private c struct.
bool autoPrintToFile
Automatically writes the stack trace to a file when enabled.
callBackPTR callback
Function pointer to be called in the internal signal handler (MUST return)
TR_BOOL_t tr_TracerHandler__defaultSetup(tr_TracerHandler_t *trTH)
Wrapper for tracer::TracerHandler::defaultSetup.
Internal C wrapper structure.
bool defaultSetup()
Basic setup, sufficient for most use cases.
std::vector< DebuggerEngines > preferredDebuggerEngines
List of preferred engines; First try them for the Tracer.
TR_DebuggerEngines_t debuggers[8]
List of preferred engines; First try them for the Tracer (0 marks the end)
bool setup(PrinterContainer printerToUse)
Sets everything up with a custom printer.
tracer::PrinterContainer obj
PrinterContainer object.
void tr_TracerHandler__setConfig(tr_TracerHandler_t *trTH, tr_TracerHandler_Config_t cfg)
Wrapper for tracer::TracerHandler::setConfig.
TR_BOOL_t autoPrintToStdErr
Prints the stack trace to stderr when enabled.
tracer::TracerHandler::Config cfg
TracerHandler config.
static TracerHandler * getTracer()
Returns a pointer to the TracerHandler object.
tracer::TracerHandler * handler
TracerHandler pointer.
enum TR_DebuggerEngines TR_DebuggerEngines_t
Wrapper for tracer::DebuggerEngines.
enum TR_BOOL TR_BOOL_t
Define some our own boolean values.
TR_BOOL_t appendToFile
Overides file co; Requires autoPrintToFile.
TR_TraceerEngines_t tracer[8]
List of preferred engines; First try them for the Tracer (0 marks the end)
void tr_defaultSetup()
Runs tracer::TracerHandler::getTracer()->defaultSetup();.
Config getConfig() const
Returns the current configuration.
int signums[64]
List of signals to handle (0 marks the end of the list)
enum TR_TraceerEngines TR_TraceerEngines_t
Wrapper for tracer::TracerEngines.
TR_BOOL_t tr_TracerHandler__setup(tr_TracerHandler_t *trTH, tr_Printer_t *pContainer)
Wrapper for tracer::TracerHandler::setup.
char logFile[1024]
The file to automatically print to; Requires autoPrintToFile.
bool autoPrintToStdErr
Prints the stack trace to stderr when enabled.
bool callDefultHandlerWhenDone
The signal handler will call the default signal handler when done.
TR_BOOL_t callDefultHandlerWhenDone
The signal handler will call the default signal handler when done.
tr_TracerHandler_Config_t tr_TracerHandler__getConfig(tr_TracerHandler_t *trTH)
Wrapper for tracer::TracerHandler::getConfig.
TR_BOOL_t autoPrintToFile
Automatically writes the stack trace to a file when enabled.
struct tr_TracerHandler tr_TracerHandler_t
Manages TracerHandler.
static void reset()
Resets the singleton.
void * callbackData
User defined data to be send to the callback function.
void * callbackData
User defined data to be send to the callback function.