Commit c6c658bb authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk
Browse files

Debugger: Fix break at qWarning()/qFatal() for Qt 5.



Use the same setting in CDB, move it to common settings page
in a follow-up commit.

Change-Id: I67d6cd706f658c616a431e9d518d52e020afa54c
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 64da60dc
...@@ -825,6 +825,14 @@ void CdbEngine::runEngine() ...@@ -825,6 +825,14 @@ void CdbEngine::runEngine()
postCommand(breakAtFunctionCommand(breakFunction), 0); postCommand(breakAtFunctionCommand(breakFunction), 0);
} }
} }
if (debuggerCore()->boolSetting(BreakOnWarning)) {
postCommand("bm /( QtCored4!qWarning", 0); // 'bm': All overloads.
postCommand("bm /( Qt5Cored!QMessageLogger::warning", 0);
}
if (debuggerCore()->boolSetting(BreakOnFatal)) {
postCommand("bm /( QtCored4!qFatal", 0); // 'bm': All overloads.
postCommand("bm /( Qt5Cored!QMessageLogger::fatal", 0);
}
if (startParameters().startMode == AttachCore) { if (startParameters().startMode == AttachCore) {
QTC_ASSERT(!m_coreStopReason.isNull(), return; ); QTC_ASSERT(!m_coreStopReason.isNull(), return; );
notifyInferiorUnrunnable(); notifyInferiorUnrunnable();
......
...@@ -5096,13 +5096,18 @@ void GdbEngine::handleNamespaceExtraction(const GdbResponse &response) ...@@ -5096,13 +5096,18 @@ void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)
} else { } else {
if (debuggerCore()->boolSetting(BreakOnAbort)) if (debuggerCore()->boolSetting(BreakOnAbort))
postCommand("-break-insert -f abort"); postCommand("-break-insert -f abort");
if (debuggerCore()->boolSetting(BreakOnWarning)) if (debuggerCore()->boolSetting(BreakOnWarning)) {
postCommand("-break-insert -f '" + qtNamespace() + "qWarning'"); postCommand("-break-insert -f '" + qtNamespace() + "qWarning'");
if (debuggerCore()->boolSetting(BreakOnFatal)) postCommand("-break-insert -f '" + qtNamespace() + "QMessageLogger::warning'");
}
if (debuggerCore()->boolSetting(BreakOnFatal)) {
postCommand("-break-insert -f '" + qtNamespace() + "qFatal'", postCommand("-break-insert -f '" + qtNamespace() + "qFatal'",
CB(handleBreakOnQFatal)); CB(handleBreakOnQFatal), QVariant(false));
else postCommand("-break-insert -f '" + qtNamespace() + "QMessageLogger::fatal'",
CB(handleBreakOnQFatal), QVariant(true));
} else {
notifyInferiorSetupOk(); notifyInferiorSetupOk();
}
} }
} }
...@@ -5119,7 +5124,8 @@ void GdbEngine::handleBreakOnQFatal(const GdbResponse &response) ...@@ -5119,7 +5124,8 @@ void GdbEngine::handleBreakOnQFatal(const GdbResponse &response)
} }
// Continue setup. // Continue setup.
notifyInferiorSetupOk(); if (response.cookie.toBool())
notifyInferiorSetupOk();
} }
void GdbEngine::notifyInferiorSetupFailed(const QString &msg) void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
......
...@@ -187,6 +187,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent) ...@@ -187,6 +187,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
"of debug information such as <i>/usr/src/debug</i> " "of debug information such as <i>/usr/src/debug</i> "
"when starting GDB.</body></html>")); "when starting GDB.</body></html>"));
// #fixme: 2.7 Move to common settings page.
checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral); checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral);
checkBoxBreakOnWarning->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning")); checkBoxBreakOnWarning->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning"));
checkBoxBreakOnWarning->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning")); checkBoxBreakOnWarning->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment