|
Pixar Arch 0.25.8
|
Architecture-specific call-stack tracing routines. More...
#include "pxr/arch/pxr.h"#include "pxr/arch/api.h"#include "pxr/arch/defines.h"#include <inttypes.h>#include <stdio.h>#include <functional>#include <vector>#include <string>#include <iosfwd>#include <ctime>Go to the source code of this file.
Namespaces | |
| namespace | pxr |
Typedefs | |
| typedef std::function< std::string(uintptr_t address)> | pxr::ArchStackTraceCallback |
| A callback to get a symbolic representation of an address. | |
| typedef void(* | pxr::ArchCrashHandlerSystemCB) (void *userData) |
| Callback for handling crashes. | |
Functions | |
| void | pxr::ArchLogFatalProcessState (const char *reason, const char *message=nullptr, const char *extraLogMsg=nullptr) |
| Dumps call-stack info to a file, prints a message to the terminal, and invokes crash handling script. | |
| void | pxr::ArchLogCurrentProcessState (const char *reason, const char *message=nullptr, const char *extraLogMsg=nullptr) |
| Dumps call-stack info to a file, and prints an informative message. | |
| void | pxr::ArchSetProcessStateLogCommand (const char *command, const char *const argv[], const char *const fatalArgv[]) |
| Sets command line that gets call-stack info and triggers crash handling script. | |
| bool | pxr::ArchIsAppCrashing () |
| Returns true if the fatal signal handler ArchLogFatalProcessState has been invoked. | |
| void | pxr::ArchLogSessionInfo (const char *crashStackTrace=NULL) |
| Log session info. | |
| void | pxr::ArchSetLogSession (const char *command, const char *const argv[], const char *const crashArgv[]) |
| Sets the command line to log sessions. | |
| void | pxr::ArchEnableSessionLogging () |
| Register the callback to invoke logging at end of a successful session. | |
| void | pxr::ArchPrintStackTrace (FILE *fout, const std::string &programName, const std::string &reason) |
| Print a stack trace to the given FILE pointer. | |
| void | pxr::ArchPrintStackTrace (FILE *fout, const std::string &reason) |
| Print a stack trace to the given FILE pointer. | |
| void | pxr::ArchPrintStackTrace (std::ostream &out, const std::string &programName, const std::string &reason) |
| Print a stack trace to the given ostream. | |
| void | pxr::ArchPrintStackTrace (std::ostream &out, const std::string &reason) |
| Print a stack trace to the given ostream. | |
| void | pxr::ArchSetStackTraceCallback (const ArchStackTraceCallback &cb) |
| Sets a callback to get a symbolic representation of an address. | |
| void | pxr::ArchGetStackTraceCallback (ArchStackTraceCallback *cb) |
| Returns the callback to get a symbolic representation of an address. | |
| time_t | pxr::ArchGetAppLaunchTime () |
| Returns the set value for the application's launch time. | |
| void | pxr::ArchSetFatalStackLogging (bool flag) |
| Enables or disables the automatic logging of crash information. | |
| bool | pxr::ArchGetFatalStackLogging () |
| Returns whether automatic logging of fatal crashes is enabled This is set to false by default. | |
| void | pxr::ArchSetProgramNameForErrors (const char *progName) |
| Sets the program name to be used in diagnostic output. | |
| const char * | pxr::ArchGetProgramNameForErrors () |
| Returns the currently set program name for reporting errors. | |
| void | pxr::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. | |
| std::string | pxr::ArchGetProgramInfoForErrors (const std::string &key) |
| Returns currently set program info. | |
| void | pxr::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. | |
| void | pxr::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. | |
| void | pxr::ArchLogStackTrace (const std::string &reason, bool fatal=false, const std::string &sessionLog="") |
| Logs a stack trace to a file in /var/tmp. | |
| std::vector< std::string > | pxr::ArchGetStackTrace (size_t maxDepth) |
| Return stack trace. | |
| void | pxr::ArchGetStackFrames (size_t maxDepth, std::vector< uintptr_t > *frames) |
| Save frames of current stack. | |
| size_t | pxr::ArchGetStackFrames (size_t maxDepth, uintptr_t *frames) |
Store at most maxDepth frames of the current stack into frames. | |
| void | pxr::ArchGetStackFrames (size_t maxDepth, size_t numFramesToSkipAtTop, std::vector< uintptr_t > *frames) |
| Save frames of current stack. | |
| size_t | pxr::ArchGetStackFrames (size_t maxDepth, size_t numFramesToSkipAtTop, uintptr_t *frames) |
Store at most maxDepth frames of the current stack into frames, skipping the first numFramesToSkipAtTop frames. | |
| void | pxr::ArchPrintStackFrames (std::ostream &out, const std::vector< uintptr_t > &frames, bool skipUnknownFrames=false) |
| Print stack frames to the given ostream. | |
| int | pxr::ArchCrashHandlerSystemv (const char *pathname, char *const argv[], int timeout, ArchCrashHandlerSystemCB callback, void *userData) |
| Replacement for 'system' safe for a crash handler. | |
Architecture-specific call-stack tracing routines.