|
hydrogen 1.2.6
|
Crash reporter class. More...
#include <Reporter.h>
Public Slots | |
| void | on_finished (int exitCode, QProcess::ExitStatus exitStatus) |
| void | on_openLog (void) |
| void | on_readyReadStandardError (void) |
| void | on_readyReadStandardOutput (void) |
Public Member Functions | |
| Reporter (QProcess *child) | |
| ~Reporter () | |
Static Public Member Functions | |
| static void | handleSignal (int nSignal) |
| static void | report (void) |
| Report some crash details in a crashing child (mostly, the Logger 'crash context' string) | |
| static void | spawn (int argc, char *argv[]) |
| Potentially spawn child process. | |
Private Member Functions | |
| void | addLine (QString s) |
| void | waitForFinished () |
Private Attributes | |
| std::deque< QString > | m_lines |
| QProcess * | m_pChild |
| QString | m_sContext |
Static Private Attributes | |
| static std::set< QProcess * > | m_children |
| static QString | m_sLogFile |
| static QString | m_sPrefix = "Fatal error in: " |
Crash reporter class.
The crash reporter provides a split-process model for reporting crashes from Hydrogen, with a simple GUI giving options to view the log file, other details or open a browser to the issue tracker.
Early on, the calling process should call Reporter::spawn(). For the parent process, this causes the child to be spawned (adding "--child" to command line arguments), and the parent process will wait for the termination of the child, and report a crash if an abnormal exit occurs, or just exit silently otherwise. The parent never returns from Reporter::spawn().
The child process will identify itself through having "--child" in the command line arguments, and continue as normal.
The Logger 'crash context' can be reported by the child process during a crash by using Reporter::report().
The parent process passes through stdout and sterr from the child process, but also notes any reported crash context, which is communicated by stderr with a specific prefix. Recent lines from stderr / stdout are recorded in the parent (reporter) process to be displayed as crash details if needed.
Definition at line 54 of file Reporter.h.
| Reporter | ( | QProcess * | child | ) |
Definition at line 66 of file Reporter.cpp.
| ~Reporter | ( | ) |
Definition at line 84 of file Reporter.cpp.
|
private |
Definition at line 40 of file Reporter.cpp.
|
static |
Definition at line 203 of file Reporter.cpp.
|
slot |
Definition at line 131 of file Reporter.cpp.
|
slot |
Definition at line 125 of file Reporter.cpp.
|
slot |
Definition at line 111 of file Reporter.cpp.
|
slot |
Definition at line 118 of file Reporter.cpp.
|
static |
Report some crash details in a crashing child (mostly, the Logger 'crash context' string)
Definition at line 98 of file Reporter.cpp.
|
static |
Potentially spawn child process.
Definition at line 225 of file Reporter.cpp.
|
private |
Definition at line 89 of file Reporter.cpp.
|
staticprivate |
Definition at line 69 of file Reporter.h.
|
private |
Definition at line 59 of file Reporter.h.
|
private |
Definition at line 58 of file Reporter.h.
|
private |
Definition at line 62 of file Reporter.h.
|
staticprivate |
Definition at line 63 of file Reporter.h.
|
staticprivate |
Definition at line 61 of file Reporter.h.