forked from qt-creator/qt-creator
debugger: implement an option to stop on qWarnings (gdb only)
Task-number: QTCREATORBUG-842 Change-Id: If1a7d0cd9dfaa5b6b4915fa67a150683cf6786b9 Reviewed-on: http://codereview.qt.nokia.com/226 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -321,6 +321,14 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
|||||||
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnCatch"));
|
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnCatch"));
|
||||||
insertItem(BreakOnCatch, item);
|
insertItem(BreakOnCatch, item);
|
||||||
|
|
||||||
|
item = new SavedAction(this);
|
||||||
|
item->setText(tr("Break on \"qWarning\""));
|
||||||
|
item->setCheckable(true);
|
||||||
|
item->setDefaultValue(false);
|
||||||
|
item->setValue(false);
|
||||||
|
item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnWarning"));
|
||||||
|
insertItem(BreakOnWarning, item);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Settings
|
// Settings
|
||||||
//
|
//
|
||||||
|
@@ -150,6 +150,7 @@ enum DebuggerActionCode
|
|||||||
SelectedPluginBreakpointsPattern,
|
SelectedPluginBreakpointsPattern,
|
||||||
BreakOnThrow,
|
BreakOnThrow,
|
||||||
BreakOnCatch,
|
BreakOnCatch,
|
||||||
|
BreakOnWarning,
|
||||||
|
|
||||||
// Registers
|
// Registers
|
||||||
AlwaysAdjustRegistersColumnWidths,
|
AlwaysAdjustRegistersColumnWidths,
|
||||||
|
@@ -4726,11 +4726,14 @@ void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)
|
|||||||
setQtNamespace(ns + "::");
|
setQtNamespace(ns + "::");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startParameters().startMode == AttachCore)
|
if (startParameters().startMode == AttachCore) {
|
||||||
notifyInferiorSetupOk(); // No breakpoints in core files.
|
notifyInferiorSetupOk(); // No breakpoints in core files.
|
||||||
else
|
} else {
|
||||||
postCommand("-break-insert -f '" + qtNamespace() + "qFatal'",
|
postCommand("-break-insert -f '" + qtNamespace() + "qFatal'",
|
||||||
CB(handleBreakOnQFatal));
|
CB(handleBreakOnQFatal));
|
||||||
|
if (debuggerCore()->boolSetting(BreakOnWarning))
|
||||||
|
postCommand("-break-insert -f '" + qtNamespace() + "qWarning'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::handleBreakOnQFatal(const GdbResponse &response)
|
void GdbEngine::handleBreakOnQFatal(const GdbResponse &response)
|
||||||
|
@@ -94,6 +94,8 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
|
|||||||
m_ui->checkBoxTargetAsync);
|
m_ui->checkBoxTargetAsync);
|
||||||
m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
|
m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
|
||||||
m_ui->checkBoxAdjustBreakpointLocations);
|
m_ui->checkBoxAdjustBreakpointLocations);
|
||||||
|
m_group.insert(debuggerCore()->action(BreakOnWarning),
|
||||||
|
m_ui->checkBoxBreakOnWarning);
|
||||||
m_group.insert(debuggerCore()->action(GdbWatchdogTimeout),
|
m_group.insert(debuggerCore()->action(GdbWatchdogTimeout),
|
||||||
m_ui->spinBoxGdbWatchdogTimeout);
|
m_ui->spinBoxGdbWatchdogTimeout);
|
||||||
|
|
||||||
|
@@ -123,6 +123,13 @@ on slow machines. In this case, the value should be increased.</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" colspan="2">
|
<item row="7" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="checkBoxBreakOnWarning">
|
||||||
|
<property name="text">
|
||||||
|
<string>Stop when a qWarning is issued</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
|
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>Selecting this enables reverse debugging.</p><.p><b>Note:</b>This feature is very slow and unstable on the GDB side. It exhibits unpredictable behaviour when going backwards over system calls and is very likely to destroy your debugging session.</p><body></html></string>
|
<string><html><head/><body><p>Selecting this enables reverse debugging.</p><.p><b>Note:</b>This feature is very slow and unstable on the GDB side. It exhibits unpredictable behaviour when going backwards over system calls and is very likely to destroy your debugging session.</p><body></html></string>
|
||||||
|
@@ -2612,6 +2612,13 @@ void testEigen()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://bugreports.qt.nokia.com/browse/QTCREATORBUG-842
|
||||||
|
void test842()
|
||||||
|
{
|
||||||
|
qWarning("Test");
|
||||||
|
int x = 0;
|
||||||
|
++x;
|
||||||
|
}
|
||||||
|
|
||||||
// http://bugreports.qt.nokia.com/browse/QTCREATORBUG-4019
|
// http://bugreports.qt.nokia.com/browse/QTCREATORBUG-4019
|
||||||
class A4019
|
class A4019
|
||||||
@@ -2654,8 +2661,9 @@ void test4497()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//test4497();
|
test842();
|
||||||
test4019();
|
test4019();
|
||||||
|
//test4497();
|
||||||
testEigen();
|
testEigen();
|
||||||
testKR();
|
testKR();
|
||||||
int *x = new int(32);
|
int *x = new int(32);
|
||||||
|
Reference in New Issue
Block a user