CrashHandler: Allow to deactivate the Crash Handler

...by adding QTC_NO_CRASH_HANDLER=1 to the run environment.

This is important for nightly tests since these should be able to create
a core dump file.

Change-Id: Id858b64f00315def6b4f32de972b167a293be245
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Nikolai Kosjar
2013-03-21 18:12:54 +01:00
committed by hjk
parent 84d9069d94
commit f1b358562c
3 changed files with 10 additions and 2 deletions

View File

@@ -127,8 +127,10 @@ void CrashHandlerDialog::setApplicationInfo(const QString &signalName)
const QString title = tr("%1 has closed unexpectedly (Signal \"%2\")").arg(ideName, signalName); const QString title = tr("%1 has closed unexpectedly (Signal \"%2\")").arg(ideName, signalName);
const QString introLabelContents = tr( const QString introLabelContents = tr(
"<p><b>%1.</b></p>" "<p><b>%1.</b></p>"
"<p>Please file a <a href='%2'>bug report</a> with the debug information provided below.</p>") "<p>Please file a <a href='%2'>bug report</a> with the debug information provided below.</p>"
.arg(title, QLatin1String(URL_BUGTRACKER)); "<p>Hint: Deactivate this Crash Handler by adding QTC_NO_CRASH_HANDLER=1<br/>"
"to the environment (evaluated on startup of %3).</p>")
.arg(title, QLatin1String(URL_BUGTRACKER), ideName);
m_ui->introLabel->setText(introLabelContents); m_ui->introLabel->setText(introLabelContents);
setWindowTitle(title); setWindowTitle(title);

View File

@@ -37,6 +37,9 @@
<property name="text"> <property name="text">
<string>Some useful information here...</string> <string>Some useful information here...</string>
</property> </property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@@ -83,6 +83,9 @@ extern "C" void signalHandler(int signal)
void setupCrashHandler() void setupCrashHandler()
{ {
#ifdef BUILD_CRASH_HANDLER #ifdef BUILD_CRASH_HANDLER
if (!qgetenv("QTC_NO_CRASH_HANDLER").isEmpty())
return;
const QString crashHandlerPath = qApp->applicationDirPath() const QString crashHandlerPath = qApp->applicationDirPath()
+ QLatin1String("/qtcreator_crash_handler"); + QLatin1String("/qtcreator_crash_handler");
crashHandlerPathC = qstrdup(qPrintable(crashHandlerPath)); crashHandlerPathC = qstrdup(qPrintable(crashHandlerPath));