37 #if UINTPTR_MAX == 0xffffffff // 32-bit 38 typedef uint32_t Address;
39 #elif UINTPTR_MAX == 0xffffffffffffffff // 64-bit 40 typedef uint64_t Address;
42 #error "Could not detect address legth" 53 enum TR_TraceerEngines { TR_E_END = 0, TR_LIBUNWIND, TR_GLIBC, TR_WIN32_TRACER, TR_DUMMY_T };
56 enum TR_DebuggerEngines { TR_D_END = 0, TR_LIBDWFL, TR_LIBBFD, TR_WIN32_INFO, TR_EXTERNAL_FALLBACK, TR_DUMMY_D };
67 TR_TraceerEngines_t tracer[8];
90 char colorFrameNum[64];
91 char colorNotFound[64];
92 char colorAddress[64];
93 char colorFuncName[64];
94 char colorLineInfo[64];
114 TR_TraceerEngines_t tracer[8];
void tr_Printer__disableColor(tr_Printer_t *p, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::disableColor.
void(* tr_callBackPTR)(void *tracer, void *printer, void *userData)
C user callback for the signal handler.
void tr_Printer__setSignum(tr_Printer_t *p, int signum, TR_BOOL_t *castOK)
Wrapper for tracer::SystemInfoPrinter::setSignum.
tr_Printer_t * tr_getPrinter__file()
Wrapper for tracer::PrinterContainer::file.
const char * funcName
The name of the function.
void tr_Printer__setTrace(tr_Printer_t *p, tr_Tracer_t *t, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::setTrace.
int line
The line number in the source file.
const char * fileName
The name / path of the source file.
void tr_TracerHandler__setConfig(tr_TracerHandler_t *trTH, tr_TracerHandler_Config_t cfg)
Wrapper for tracer::TracerHandler::setConfig.
TR_BOOL
Private struct to manage PrinterContainer.
tr_callBackPTR callback
Function pointer to be called in the internal signal handler (MUST return)
void tr_Tracer__trace(tr_Tracer_t *tracer)
Wrapper for tracer::Tracer::trace.
size_t tr_Tracer__getNumFrames(tr_Tracer_t *tracer)
(Indirect) Wrapper for tracer::Tracer::getFrames
Internal C wrapper structure.
TR_BOOL_t tr_TracerHandler__setup(tr_TracerHandler_t *trTH, tr_Printer_t *pContainer)
Wrapper for tracer::TracerHandler::setup.
tr_Tracer_t * tr_getTracerFromVoid(void *tVoid)
Creates the priavet C struct form a void pointer to the C++ Tracer object.
void tr_Printer__printToStdOut(tr_Printer_t *p, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::printToStdOut.
void tr_Printer__enableColor(tr_Printer_t *p, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::enableColor.
TR_TraceerEngines
Wrapper for tracer::TracerEngines.
void tr_Printer__generateString(tr_Printer_t *p, char **outStr, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::generateString.
tr_Printer_t * tr_getPrinter__system()
Wrapper for tracer::PrinterContainer::system.
Internal C wrapper structure.
tr_DefaultPrinter_Config_t tr_Printer__getConfig(tr_Printer_t *p, TR_BOOL_t *castOK)
Wrapper for tracer::DefaultPrinter::getConfig.
tr_Tracer_t * tr_getTracer()
Wrapper for tracer::Tracer::Tracer.
tr_Tracer_AvailableEngines_t tr_Tracer__getAvailableEngines()
(Indirect) Wrapper for tracer::Tracer::getAvailableEngines and tracer::Tracer::getAvailableDebuggers ...
TR_DebuggerEngines_t debuggers[8]
List of preferred engines; First try them for the Tracer (0 marks the end)
tr_Printer_t * tr_getPrinter(void *printer)
Manages the Printer.
TR_DebuggerEngines
Wrapper for tracer::DebuggerEngines.
void tr_Printer__genStringPostFrame(tr_Printer_t *p, size_t frameNum, char **outStr, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::genStringPostFrame.
void tr_Printer__setConfig(tr_Printer_t *p, tr_DefaultPrinter_Config_t cfg, TR_BOOL_t *castOK)
Wrapper for tracer::DefaultPrinter::setConfig.
tr_TracerHandler_t * tr_getTracerHandler()
Retunrns the handler as a private c struct.
TR_BOOL_t shortenFiles
The source file path.
tr_Printer_t * tr_getPrinter__plain()
Wrapper for tracer::PrinterContainer::plain.
TR_BOOL_t autoPrintToStdErr
Prints the stack trace to stderr when enabled.
TR_BOOL_t canonicalizePaths
Fixes path names if they contain "/../" or are relative.
void * tr_PrinterContainer__get(tr_Printer_t *pContainer)
Wrapper for tracer::PrinterContainer::get.
TR_BOOL_t tr_TracerHandler__defaultSetup(tr_TracerHandler_t *trTH)
Wrapper for tracer::TracerHandler::defaultSetup.
const char * moduleName
The name / path of the binary file.
Represents a stack frame.
void tr_Printer__addSystemEntry(tr_Printer_t *p, const char *name, const char *value, TR_BOOL_t *castOK)
Wrapper for tracer::SystemInfoPrinter::addSystemEntry.
Internal C wrapper structure.
Address frameAddr
The instruction pointer of the stack frame.
TR_BOOL_t shortenModules
The executable module (.so/.dll/.exe)
Helper structure for wrapping the small std::vector's.
enum TR_DebuggerEngines TR_DebuggerEngines_t
Wrapper for tracer::DebuggerEngines.
enum TR_BOOL TR_BOOL_t
Define some our own boolean values.
void tr_Printer__printToStdErr(tr_Printer_t *p, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::printToStdErr.
void tr_Printer__printToFile(tr_Printer_t *p, const char *file, TR_BOOL_t append, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::printToFile.
void tr_Printer__genStringPreFrame(tr_Printer_t *p, size_t frameNum, char **outStr, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::genStringPreFrame.
tr_Printer_t * tr_getPrinter__fancy()
Wrapper for tracer::PrinterContainer::fancy.
tr_Tracer_t * tr_getTracerWithParam(TR_TraceerEngines_t tracer, TR_DebuggerEngines_t debugInfo)
Wrapper for tracer::Tracer::Tracer(TraceerEngines, DebuggerEngines)
void tr_freeTracer(tr_Tracer_t *tracer)
Destroyes the private C object and the Tracer C++ object UNLESS tr_getTracerFromVoid was used...
int column
The column in the source file.
void tr_freeTracerHandler(tr_TracerHandler_t *trTH)
Frees the handler.
TR_BOOL_t appendToFile
Overides file co; Requires autoPrintToFile.
User configuration structure.
tr_Frame_t tr_Tracer__getFrame(tr_Tracer_t *tracer, size_t frameNum)
(Indirect) Wrapper for tracer::Tracer::getFrames
int signums[64]
List of signals to handle (0 marks the end of the list)
void tr_TracerHandler__reset()
Wrapper for tracer::TracerHandler::reset.
enum TR_TraceerEngines TR_TraceerEngines_t
Wrapper for tracer::TracerEngines.
char logFile[1024]
The file to automatically print to; Requires autoPrintToFile.
void tr_freePrinter(tr_Printer_t *pContainer)
Frees the Printer container.
TR_BOOL_t callDefultHandlerWhenDone
The signal handler will call the default signal handler when done.
void tr_Printer__genStringForFrame(tr_Printer_t *p, size_t frameNum, char **outStr, TR_BOOL_t *castOK)
Wrapper for tracer::AbstractPrinter::genStringForFrame.
TR_BOOL_t autoPrintToFile
Automatically writes the stack trace to a file when enabled.
void * callbackData
User defined data to be send to the callback function.
tr_TracerHandler_Config_t tr_TracerHandler__getConfig(tr_TracerHandler_t *trTH)
Wrapper for tracer::TracerHandler::getConfig.
void tr_defaultSetup()
Runs tracer::TracerHandler::getTracer()->defaultSetup();.