stackTrace.h File Reference

Architecture-specific call-stack tracing routines. More...

+ Include dependency graph for stackTrace.h:

Go to the source code of this file.

Typedefs

typedef std::function< std::string(uintptr_t address)> ArchStackTraceCallback
 A callback to get a symbolic representation of an address. More...
 
typedef void(* ArchCrashHandlerSystemCB) (void *userData)
 Callback for handling crashes. More...
 

Functions

ARCH_API void ArchLogPostMortem (const char *reason, const char *message=nullptr, const char *extraLogMsg=nullptr)
 Dumps call-stack info to a file, and prints an informative message. More...
 
ARCH_API void ArchSetPostMortem (const char *command, const char *const argv[])
 Sets the command line that gathers call-stack info. More...
 
ARCH_API void ArchLogSessionInfo (const char *crashStackTrace=NULL)
 Log session info. More...
 
ARCH_API void ArchSetLogSession (const char *command, const char *const argv[], const char *const crashArgv[])
 Sets the command line to log sessions. More...
 
ARCH_API void ArchEnableSessionLogging ()
 Register the callback to invoke logging at end of a successful session. More...
 
ARCH_API void ArchPrintStackTrace (FILE *fout, const std::string &programName, const std::string &reason)
 Print a stack trace to the given FILE pointer. More...
 
ARCH_API void ArchPrintStackTrace (FILE *fout, const std::string &reason)
 Print a stack trace to the given FILE pointer. More...
 
ARCH_API void ArchPrintStackTrace (std::ostream &out, const std::string &programName, const std::string &reason)
 Print a stack trace to the given ostream. More...
 
ARCH_API void ArchPrintStackTrace (std::ostream &out, const std::string &reason)
 Print a stack trace to the given ostream. More...
 
ARCH_API void ArchSetStackTraceCallback (const ArchStackTraceCallback &cb)
 Sets a callback to get a symbolic representation of an address. More...
 
ARCH_API void ArchGetStackTraceCallback (ArchStackTraceCallback *cb)
 Returns the callback to get a symbolic representation of an address. More...
 
ARCH_API time_t ArchGetAppLaunchTime ()
 Returns the set value for the application's launch time. More...
 
ARCH_API void ArchSetFatalStackLogging (bool flag)
 Enables or disables the automatic logging of crash information. More...
 
ARCH_API bool ArchGetFatalStackLogging ()
 Returns whether automatic logging of fatal crashes is enabled This is set to false by default. More...
 
ARCH_API void ArchSetProgramNameForErrors (const char *progName)
 Sets the program name to be used in diagnostic output. More...
 
ARCH_API const char * ArchGetProgramNameForErrors ()
 Returns the currently set program name for reporting errors. More...
 
ARCH_API void ArchSetProgramInfoForErrors (const std::string &key, const std::string &value)
 Sets additional program info to be reported to the terminal in case of a fatal error. More...
 
ARCH_API std::string ArchGetProgramInfoForErrors (const std::string &key)
 Returns currently set program info. More...
 
ARCH_API void ArchSetExtraLogInfoForErrors (const std::string &key, std::vector< std::string > const *lines)
 Stores (or removes if lines is nullptr) a pointer to additional log data that will be output in the stack trace log in case of a fatal error. More...
 
ARCH_API void ArchLogStackTrace (const std::string &progName, const std::string &reason, bool fatal=false, const std::string &sessionLog="")
 Logs a stack trace to a file in /var/tmp. More...
 
ARCH_API void ArchLogStackTrace (const std::string &reason, bool fatal=false, const std::string &sessionLog="")
 Logs a stack trace to a file in /var/tmp. More...
 
ARCH_API std::vector< std::string > ArchGetStackTrace (size_t maxDepth)
 Return stack trace. More...
 
ARCH_API void ArchGetStackFrames (size_t maxDepth, std::vector< uintptr_t > *frames)
 Save frames of current stack. More...
 
ARCH_API void ArchGetStackFrames (size_t maxDepth, size_t numFramesToSkipAtTop, std::vector< uintptr_t > *frames)
 Save frames of current stack. More...
 
ARCH_API void ArchPrintStackFrames (std::ostream &out, const std::vector< uintptr_t > &frames, bool skipUnknownFrames=false)
 Print stack frames to the given ostream. More...
 
ARCH_API int ArchCrashHandlerSystemv (const char *pathname, char *const argv[], int timeout, ArchCrashHandlerSystemCB callback, void *userData)
 Replacement for 'system' safe for a crash handler. More...
 

Detailed Description

Architecture-specific call-stack tracing routines.

Definition in file stackTrace.h.