Vidalia
0.3.1
|
Typedefs | |
typedef char | _char_t |
typedef int | _file_handle_t |
Functions | |
static size_t | append_string (_char_t *dst, const _char_t *src, size_t siz) |
static void | write_keyval_to_file (_file_handle_t hFile, const char *key, const char *val) |
static bool | write_extra_dump_info (const _char_t *path, const _char_t *id, time_t crashTime) |
bool | minidump_callback (const _char_t *path, const _char_t *id, void *context, bool succeeded) |
bool | install_exception_handler (const QString &dumpPath) |
void | remove_exception_handler (void) |
bool | set_crash_reporter (const QString &crashReporter) |
bool | set_restart_options (const QString &executable, const QStringList &arguments) |
bool | set_build_version (const QString &version) |
Variables | |
static google_breakpad::ExceptionHandler * | exceptionHandler = 0 |
static bool | showCrashReporter = false |
static _char_t | crashReporterExecutable [MAX_PATH_LEN+1] = TEXT("") |
static char | buildVersion [MAX_VERSION_LEN+1] = "" |
static char | restartExecutable [MAX_CMD_LEN+1] = "" |
static char | restartExecutableArgs [MAX_CMD_LEN+1] = "" |
static time_t | startupTime = 0 |
static const int | MAX_PATH_LEN = 4096 |
static const int | MAX_CMD_LEN = 32768 |
static const int | MAX_VERSION_LEN = 64 |
typedef char CrashReporter::_char_t |
Definition at line 85 of file CrashReporter.cpp.
typedef int CrashReporter::_file_handle_t |
Definition at line 86 of file CrashReporter.cpp.
|
static |
Slightly modified version of the strlcat() implementation by Todd C. Miller (see the top of this file or the LICENSE file for license details), that supports arguments of either wchar_t* on Windows or the usual char* everywhere else but retains the semantics of strlcat().
Definition at line 148 of file CrashReporter.cpp.
References TEXT.
Referenced by minidump_callback(), and write_extra_dump_info().
bool CrashReporter::install_exception_handler | ( | const QString & | dumpPath | ) |
Installs the Breakpad exception handler and sets the static global variables used by the exception handler to launch the crash reporting application. Minidumps will be writen to dumpPath, which will be created if it doesn't already exist.
Definition at line 338 of file CrashReporter.cpp.
References minidump_callback().
bool CrashReporter::minidump_callback | ( | const _char_t * | path, |
const _char_t * | id, | ||
void * | context, | ||
bool | succeeded | ||
) |
Breakpad-installed exception handler. This function gets called in the event of a crash. If showCrashReporter is true, this will execute the crash reporting application, passing it the name and location of the generated minidump, the absolute path to the (now crashed) Vidalia executable, and any arguments that may be needed to restart Vidalia.
Definition at line 263 of file CrashReporter.cpp.
References append_string(), crashReporterExecutable, MAX_CMD_LEN, p(), PATH_SEPARATOR, TEXT, and write_extra_dump_info().
Referenced by install_exception_handler().
Removes the application's exception handler previously created by install_exception_handler(). If no exception handler was previously created, no action will be taken.
Definition at line 368 of file CrashReporter.cpp.
References exceptionHandler.
Referenced by main().
bool CrashReporter::set_build_version | ( | const QString & | version | ) |
Sets version as the build version identifier written to the extra information file alongside a minidump. The version string must be no longer than CrashReporter::MAX_VERSION_LEN.
Definition at line 421 of file CrashReporter.cpp.
References MAX_VERSION_LEN.
bool CrashReporter::set_crash_reporter | ( | const QString & | crashReporter | ) |
Sets crashReporter as the executable that gets called when the exception handler catches a crash. If crashReporter contains one or more spaces, the given path will be wrapped in quotes. The caller is responsible for ensuring that crashReporter is no greater than CrashReporter::MAX_PATH_LEN (including added quotes). Returns true if the crash reporting application was set successfully, or false if crashReporter was too long.
Definition at line 377 of file CrashReporter.cpp.
References MAX_PATH_LEN, and showCrashReporter.
bool CrashReporter::set_restart_options | ( | const QString & | executable, |
const QStringList & | arguments | ||
) |
Sets the executable and args that will be passed to the crash reporting application, so it can restart the crashed application with the same arguments as before it crashed. If the executable path or any of args contains a space, they will be quoted before being passed to the crash reporting application. The path to the generated minidump, crash reporting application, executable to restart and any arguments must fit within MAX_CMD_LEN, including any added quotes.
Definition at line 401 of file CrashReporter.cpp.
References MAX_CMD_LEN, and string_format_arguments().
|
static |
Writes to a file extra information used by the crash reporting application such as how long the application was running before it crashed, the application to restart, as well as any extra arguments. The contents of the file are formatted as a series of "Key=Val\n" pairs. The written file has the same path and base filename as the minidump file, with ".info" appended to the end. Returns true if the file was created succesfully. Otherwise, returns false.
Definition at line 210 of file CrashReporter.cpp.
References append_string(), MAX_PATH_LEN, PATH_SEPARATOR, TEXT, TIME_TO_STRING, and write_keyval_to_file().
Referenced by minidump_callback().
|
static |
Writes the formatted string "<b>key</b>=</b>val\n" to the file handle specified by hFile. On Windows, hFile is a HANDLE. Everywhere else, hFile is an int.
Definition at line 185 of file CrashReporter.cpp.
Referenced by write_extra_dump_info().
|
static |
Version information for the application being monitored for crashes. The version will be written to the extra information file alongside the minidump.
Definition at line 116 of file CrashReporter.cpp.
|
static |
Absolute path of the crash reporting application that will be launched from the exception handler.
Definition at line 110 of file CrashReporter.cpp.
Referenced by minidump_callback().
|
static |
Pointer to the Breakpad-installed exception handler called if Vidalia crashes.
Definition at line 97 of file CrashReporter.cpp.
Referenced by remove_exception_handler().
|
static |
Defines the maximum length of the command line arguments used to restart the crashed application by the crash reporter. The maximum command line length is based on Windows' 32K character command line limit, according to the MSDN documents.
Definition at line 41 of file CrashReporter.h.
Referenced by minidump_callback(), and set_restart_options().
|
static |
Defines the maximum length of the absolute path plus filename of the crash reporting executable displayed when the exception handler is called.
Definition at line 33 of file CrashReporter.h.
Referenced by set_crash_reporter(), and write_extra_dump_info().
|
static |
Defines the maximum length of a build version string that can be set by set_build_version().
Definition at line 47 of file CrashReporter.h.
Referenced by set_build_version().
|
static |
Path and filename of the application to restart after displaying the crash reporting dialog. The contents of this string are encoded in UTF-8.
Definition at line 123 of file CrashReporter.cpp.
|
static |
Additional arguments to use when restarting the crashed application. The contents of this string are encoded in UTF-8.
Definition at line 129 of file CrashReporter.cpp.
|
static |
If true, the crash reporting application will be displayed when the Breakpad-installed exception handler is called. Otherwise, the system will handle the exception itself.
Definition at line 104 of file CrashReporter.cpp.
Referenced by set_crash_reporter().
|
static |
Records the time at which install_exception_handler() is called, which is usually as early as possible during application startup. This is used in minidump_callback() to determine how long the application was running before it crashed.
Definition at line 139 of file CrashReporter.cpp.