diff --git a/src/plugins/debugger/breakcondition.ui b/src/plugins/debugger/breakcondition.ui index a3e2e9babba462b9c7ca848c3af7c0660012fd8a..cc9e5d1b319bde83071383dbf6e546f603a27480 100644 --- a/src/plugins/debugger/breakcondition.ui +++ b/src/plugins/debugger/breakcondition.ui @@ -2,55 +2,37 @@ <ui version="4.0"> <class>BreakCondition</class> <widget class="QDialog" name="BreakCondition"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>435</width> - <height>142</height> - </rect> - </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> - <widget class="QLabel" name="labelFunction"> - <property name="text"> - <string>Function:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="lineEditFunction"/> - </item> - <item row="1" column="0"> <widget class="QLabel" name="labelCondition"> <property name="text"> <string>Condition:</string> </property> </widget> </item> - <item row="1" column="1"> + <item row="0" column="1"> <widget class="QLineEdit" name="lineEditCondition"/> </item> - <item row="2" column="0"> + <item row="1" column="0"> <widget class="QLabel" name="labelIgnoreCount"> <property name="text"> <string>Ignore count:</string> </property> </widget> </item> - <item row="2" column="1"> + <item row="1" column="1"> <widget class="QLineEdit" name="lineEditIgnoreCount"/> </item> - <item row="3" column="0"> + <item row="2" column="0"> <widget class="QLabel" name="labelThreadSpec"> <property name="text"> <string>Thread specification:</string> </property> </widget> </item> - <item row="3" column="1"> + <item row="2" column="1"> <widget class="QLineEdit" name="lineEditThreadSpec"/> </item> </layout> diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index e0428f8cf5642d1986b7ffe53b4c602bff530d01..4006f2965d6ceb6e89623fecc65cf9f9cc51c04b 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -283,10 +283,10 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const if (mi.row() >= size()) return QVariant(); - const BreakpointData *data = at(mi.row()); + BreakpointData *data = at(mi.row()); if (role == BreakpointRole) - return qulonglong(data); + return qVariantFromValue(data); if (role == BreakpointUseFullPathRole) return data->useFullPath; diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 38c97bc440ab63cc7c09050cfaec047d20eded90..e564a745121406663dd81ea386ef6852ebb4b1c0 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -64,54 +64,76 @@ class BreakpointDialog : public QDialog, public Ui::BreakpointDialog { Q_OBJECT public: - explicit BreakpointDialog(QWidget *parent, BreakpointData *data) - : QDialog(parent) - { - setupUi(this); - comboBoxType->insertItem(0, tr("File and Line Number")); - comboBoxType->insertItem(1, tr("Function Name")); - comboBoxType->insertItem(2, tr("Function \"main()\"")); - comboBoxType->insertItem(3, tr("Address")); - pathChooserFileName->lineEdit()->setText(data->fileName); - pathChooserFileName->setExpectedKind(Utils::PathChooser::File); - lineEditLineNumber->setText(QByteArray::number(data->lineNumber)); - lineEditFunction->setText(data->funcName); - lineEditCondition->setText(data->condition); - lineEditIgnoreCount->setText(QByteArray::number(data->ignoreCount)); - checkBoxUseFullPath->setChecked(data->useFullPath); - if (data->address) - lineEditAddress->setText("0x" + QByteArray::number(data->address, 16)); - int initialType = 0; - if (!data->funcName.isEmpty()) - initialType = lineEditFunction->text() == "main" ? 2 : 1; - if (data->address) - initialType = 3; - typeChanged(initialType); - connect(comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int))); - } + explicit BreakpointDialog(QWidget *parent); + bool showDialog(BreakpointData *data); public slots: - void typeChanged(int index) - { - const bool isLineVisible = index == 0; - const bool isFunctionVisible = index == 1; - const bool isAddressVisible = index == 3; - labelFileName->setEnabled(isLineVisible); - pathChooserFileName->setEnabled(isLineVisible); - labelLineNumber->setEnabled(isLineVisible); - lineEditLineNumber->setEnabled(isLineVisible); - labelUseFullPath->setEnabled(isLineVisible); - checkBoxUseFullPath->setEnabled(isLineVisible); - labelFunction->setEnabled(isFunctionVisible); - lineEditFunction->setEnabled(isFunctionVisible); - labelAddress->setEnabled(isAddressVisible); - lineEditAddress->setEnabled(isAddressVisible); - if (index == 2) - lineEditFunction->setText("main"); - } - + void typeChanged(int index); }; +BreakpointDialog::BreakpointDialog(QWidget *parent) : QDialog(parent) +{ + setupUi(this); + comboBoxType->insertItem(0, tr("File and Line Number")); + comboBoxType->insertItem(1, tr("Function Name")); + comboBoxType->insertItem(2, tr("Function \"main()\"")); + comboBoxType->insertItem(3, tr("Address")); + pathChooserFileName->setExpectedKind(Utils::PathChooser::File); + connect(comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int))); + lineEditIgnoreCount->setValidator(new QIntValidator(0, 2147483647, lineEditIgnoreCount)); +} + +bool BreakpointDialog::showDialog(BreakpointData *data) +{ + pathChooserFileName->setPath(data->fileName); + lineEditLineNumber->setText(QString::number(data->lineNumber)); + lineEditFunction->setText(data->funcName); + lineEditCondition->setText(QString::fromUtf8(data->condition)); + lineEditIgnoreCount->setText(QString::number(data->ignoreCount)); + checkBoxUseFullPath->setChecked(data->useFullPath); + lineEditThreadSpec->setText(QString::fromUtf8(data->threadSpec)); + if (data->address) + lineEditAddress->setText(QString::fromAscii("0x%1").arg(data->address, 0, 16)); + int initialType = 0; + if (!data->funcName.isEmpty()) + initialType = data->funcName == QLatin1String("main") ? 2 : 1; + if (data->address) + initialType = 3; + typeChanged(initialType); + + if (exec() != QDialog::Accepted) + return false; + + data->lineNumber = lineEditLineNumber->text().toInt(); + data->useFullPath = checkBoxUseFullPath->isChecked(); + data->address = lineEditAddress->text().toULongLong(0, 0); + data->funcName = lineEditFunction->text(); + data->fileName = pathChooserFileName->path(); + data->condition = lineEditCondition->text().toUtf8(); + data->ignoreCount = lineEditIgnoreCount->text().toInt(); + data->threadSpec = lineEditThreadSpec->text().toUtf8(); + return true; +} + +void BreakpointDialog::typeChanged(int index) +{ + const bool isLineVisible = index == 0; + const bool isFunctionVisible = index == 1; + const bool isAddressVisible = index == 3; + labelFileName->setEnabled(isLineVisible); + pathChooserFileName->setEnabled(isLineVisible); + labelLineNumber->setEnabled(isLineVisible); + lineEditLineNumber->setEnabled(isLineVisible); + labelUseFullPath->setEnabled(isLineVisible); + checkBoxUseFullPath->setEnabled(isLineVisible); + labelFunction->setEnabled(isFunctionVisible); + lineEditFunction->setEnabled(isFunctionVisible); + labelAddress->setEnabled(isAddressVisible); + lineEditAddress->setEnabled(isAddressVisible); + if (index == 2) + lineEditFunction->setText(QLatin1String("main")); +} + /////////////////////////////////////////////////////////////////////// // // BreakWindow @@ -268,12 +290,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) QAction *toggleEnabledAction = new QAction(str5, &menu); toggleEnabledAction->setEnabled(si.size() > 0); - const bool fullpath = si.isEmpty() - || idx2.data(BreakpointEnabledRole).toBool(); - const QString str6 = fullpath ? tr("Use Short Path") : tr("Use Full Path"); - QAction *pathAction = new QAction(str6, &menu); - pathAction->setEnabled(si.size() > 0); - QAction *addBreakpointAction = new QAction(tr("Add Breakpoint..."), this); QAction *breakAtThrowAction = @@ -286,7 +302,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) menu.addAction(editBreakpointAction); menu.addAction(associateBreakpointAction); menu.addAction(toggleEnabledAction); - menu.addAction(pathAction); menu.addSeparator(); menu.addAction(deleteAllAction); menu.addAction(deleteByFileAction); @@ -328,8 +343,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) setModelData(RequestSynchronizeBreakpointsRole); else if (act == toggleEnabledAction) setBreakpointsEnabled(si, !enabled); - else if (act == pathAction) - setBreakpointsFullPath(si, !fullpath); else if (act == addBreakpointAction) addBreakpoint(); else if (act == breakAtThrowAction) @@ -378,19 +391,8 @@ void BreakWindow::deleteBreakpoints(QList<int> list) bool BreakWindow::editBreakpoint(BreakpointData *data) { - BreakpointDialog dialog(this, data); - if (dialog.exec() == QDialog::Rejected) - return false; - bool ok = false; - data->lineNumber = dialog.lineEditLineNumber->text().toInt(); - data->useFullPath = dialog.checkBoxUseFullPath->isChecked(); - data->address = dialog.lineEditAddress->text().toULongLong(&ok, 0); - data->funcName = dialog.lineEditFunction->text(); - data->fileName = dialog.pathChooserFileName->lineEdit()->text(); - data->condition = dialog.lineEditCondition->text().toUtf8(); - data->ignoreCount = dialog.lineEditIgnoreCount->text().toInt(); - data->threadSpec = dialog.lineEditThreadSpec->text().toUtf8(); - return true; + BreakpointDialog dialog(this); + return dialog.showDialog(data); } void BreakWindow::addBreakpoint() @@ -405,8 +407,9 @@ void BreakWindow::addBreakpoint() void BreakWindow::editBreakpoints(const QModelIndexList &list) { if (list.size() == 1) { - QVariant var = model()->data(list.at(0), BreakpointRole); - BreakpointData *data = (BreakpointData *)var.toULongLong(); + const QVariant dataV = model()->data(list.at(0), BreakpointRole); + QTC_ASSERT(qVariantCanConvert<BreakpointData *>(dataV), return ); + BreakpointData *data = qvariant_cast<BreakpointData *>(dataV); if (editBreakpoint(data)) data->reinsertBreakpoint(); return; @@ -420,8 +423,6 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list) QTC_ASSERT(!list.isEmpty(), return); QModelIndex idx = list.front(); dlg.setWindowTitle(tr("Edit Breakpoint Properties")); - ui.lineEditFunction->hide(); - ui.labelFunction->hide(); QAbstractItemModel *m = model(); ui.lineEditCondition->setText( m->data(idx, BreakpointConditionRole).toString()); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 0a5ded2ed5b013b8e914d0e638a65c57d02b91ea..5d4b8d1a6dcf6fa96d43ec13374e07c9f15242e2 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -333,18 +333,6 @@ DebuggerSettings *DebuggerSettings::instance() item->setText(tr("Synchronize Breakpoints")); instance->insertItem(SynchronizeBreakpoints, item); - item = new SavedAction(instance); - item->setText(tr("Use Precise Breakpoints")); - item->setToolTip(tr("Selecting this causes breakpoint synchronization " - "being done after each step. This results in up-to-date breakpoint " - "information on whether a breakpoint has been resolved after " - "loading shared libraries, but slows down stepping.")); - item->setCheckable(true); - item->setDefaultValue(false); - item->setValue(false); - item->setSettingsKey(debugModeGroup, QLatin1String("UsePreciseBreakpoints")); - instance->insertItem(UsePreciseBreakpoints, item); - item = new SavedAction(instance); item->setText(tr("Adjust Breakpoint Locations")); item->setToolTip(tr("Not all source code lines generate " diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index ebf962eb4d57ab5ed661b094b2c2092666adad48..aa59ee4bf20d07f2d19f90bf191f5db80e3f473d 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -142,7 +142,6 @@ enum DebuggerActionCode AdjustBreakpointLocations, NoPluginBreakpoints, SelectedPluginBreakpointsPattern, - UsePreciseBreakpoints, BreakOnThrow, BreakOnCatch }; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 7b65e0b6b401c60c68345a6bacc7d20862357d9b..161546f031d33c616a58bb2f815f28b9e83540b8 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -572,7 +572,6 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent) m_group.insert(theDebuggerAction(SortStructMembers), 0); m_group.insert(theDebuggerAction(LogTimeStamps), 0); m_group.insert(theDebuggerAction(VerboseLog), 0); - m_group.insert(theDebuggerAction(UsePreciseBreakpoints), 0); m_group.insert(theDebuggerAction(BreakOnThrow), 0); m_group.insert(theDebuggerAction(BreakOnCatch), 0); #ifdef Q_OS_WIN diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index cc1c27f09b3a97bc018c8f37f525c85ca778e3a0..c0692c8e0951f93cc731b79295ad3a3b8d8abf18 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1396,10 +1396,6 @@ void GdbEngine::handleStop1(const GdbMi &data) if (m_modulesListOutdated) reloadModulesInternal(); - // This needs to be done before fullName() may need it. - if (m_sourcesListOutdated && theDebuggerBoolSetting(UsePreciseBreakpoints)) - reloadSourceFilesInternal(); - if (m_breakListOutdated) { reloadBreakListInternal(); } else { @@ -2487,31 +2483,6 @@ void GdbEngine::attemptBreakpointSynchronization() return; } - // For best results, we rely on an up-to-date fullname mapping. - // The listing completion will retrigger us, so no futher action is needed. - if (m_sourcesListOutdated && theDebuggerBoolSetting(UsePreciseBreakpoints)) { - if (state() == InferiorRunOk) { - // FIXME: this is a hack - // The hack solves the problem that we want both commands - // (reloadSourceFiles and reloadBreakList) to be executed - // within the same stop-executecommand-continue cycle. - // Just calling reloadSourceFiles and reloadBreakList doesn't work - // in this case, because a) stopping the executable is asynchronous, - // b) we wouldn't want to stop-exec-continue twice - m_sourcesListUpdating = true; - GdbCommand cmd; - cmd.command = "-file-list-exec-source-files"; - cmd.flags = NoFlags; - cmd.callback = &GdbEngine::handleQuerySources; - cmd.callbackName = ""; - m_commandsToRunOnTemporaryBreak.append(cmd); - } else { - reloadSourceFilesInternal(); - } - reloadBreakListInternal(); - return; - } - if (m_breakListOutdated) { reloadBreakListInternal(); return; diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 1974b68150df7dd2f95f923d50ceabe613239499..8482a207dc117f769e94af0feec6b0d56c350155 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -83,8 +83,6 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent) m_ui.environmentEdit); m_group.insert(theDebuggerAction(AdjustBreakpointLocations), m_ui.checkBoxAdjustBreakpointLocations); - m_group.insert(theDebuggerAction(UsePreciseBreakpoints), - m_ui.checkBoxUsePreciseBreakpoints); m_group.insert(theDebuggerAction(GdbWatchdogTimeout), m_ui.spinBoxGdbWatchdogTimeout); diff --git a/src/plugins/debugger/gdb/gdboptionspage.ui b/src/plugins/debugger/gdb/gdboptionspage.ui index 5baef8d76779741f0a6698d70f6bf335b45393d1..385fa4abfee1335276d706b583c2c9c8cbab6c4d 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.ui +++ b/src/plugins/debugger/gdb/gdboptionspage.ui @@ -2,14 +2,6 @@ <ui version="4.0"> <class>GdbOptionsPage</class> <widget class="QWidget" name="GdbOptionsPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>480</width> - <height>475</height> - </rect> - </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QGroupBox" name="groupBoxLocations"> @@ -92,26 +84,13 @@ on slow machines. In this case, the value should be increased.</string> </widget> </item> <item row="4" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxUsePreciseBreakpoints"> - <property name="toolTip"> - <string>When this option is checked, the debugger plugin attempts -to extract full path information for all source files from gdb. This is a -slow process but enables setting breakpoints in files with the same file -name in different directories.</string> - </property> - <property name="text"> - <string>Use full path information to set breakpoints</string> - </property> - </widget> - </item> - <item row="5" column="0" colspan="2"> <widget class="QCheckBox" name="checkBoxEnableReverseDebugging"> <property name="text"> <string>Enable reverse debugging</string> </property> </widget> </item> - <item row="6" column="0" colspan="2"> + <item row="5" column="0" colspan="2"> <widget class="QCheckBox" name="checkBoxSkipKnownFrames"> <property name="toolTip"> <string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic @@ -122,14 +101,14 @@ name in different directories.</string> </property> </widget> </item> - <item row="7" column="0" colspan="2"> + <item row="6" column="0" colspan="2"> <widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals"> <property name="text"> <string>Show a message box when receiving a signal</string> </property> </widget> </item> - <item row="8" column="0" colspan="2"> + <item row="7" column="0" colspan="2"> <widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations"> <property name="text"> <string>Adjust Breakpoint Locations</string>