diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp index 8054397..60597c4 100644 --- a/src/SeerDebugDialog.cpp +++ b/src/SeerDebugDialog.cpp @@ -12,12 +12,6 @@ SeerDebugDialog::SeerDebugDialog (QWidget* parent) : QDialog(parent) { // Set up the UI. setupUi(this); - _runModeButtonGroup = new QButtonGroup(this); // ID's 1 thru 4. - _runModeButtonGroup->addButton(runProgramRadioButton, 1); // "run" or "start". See breakpointMode(). - _runModeButtonGroup->addButton(attachProgramRadioButton, 2); // "attach" - _runModeButtonGroup->addButton(connectProgramRadioButton, 3); // "connect" - _runModeButtonGroup->addButton(loadCoreRadioButton, 4); // "corefile" - // Setup the widgets setExecutableName(""); setExecutableSymbolName(""); @@ -34,18 +28,18 @@ SeerDebugDialog::SeerDebugDialog (QWidget* parent) : QDialog(parent) { setCoreFilename(""); // Connect things. - QObject::connect(executableNameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableNameToolButton); - QObject::connect(executableSymbolNameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableSymbolNameToolButton); - QObject::connect(executableWorkingDirectoryToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableWorkingDirectoryToolButton); - QObject::connect(loadBreakpointsFilenameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleLoadBreakpointsFilenameToolButton); - QObject::connect(loadCoreFilenameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleLoadCoreFilenameToolButton); - QObject::connect(breakpointInFunctionLineEdit, &QLineEdit::textChanged, this, &SeerDebugDialog::handleBreakpointInFunctionLineEdit); - QObject::connect(attachProgramPidToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleProgramPidToolButton); + QObject::connect(executableNameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableNameToolButton); + QObject::connect(executableSymbolNameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableSymbolNameToolButton); + QObject::connect(executableWorkingDirectoryToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableWorkingDirectoryToolButton); + QObject::connect(loadBreakpointsFilenameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleLoadBreakpointsFilenameToolButton); + QObject::connect(loadCoreFilenameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleLoadCoreFilenameToolButton); + QObject::connect(breakpointInFunctionLineEdit, &QLineEdit::textChanged, this, &SeerDebugDialog::handleBreakpointInFunctionLineEdit); + QObject::connect(attachProgramPidToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleProgramPidToolButton); #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) - QObject::connect(_runModeButtonGroup, QOverload::of(&QButtonGroup::idClicked), this, &SeerDebugDialog::handleRunModeChanged); + QObject::connect(runModeTabWidget, &QTabWidget::currentChanged, this, &SeerDebugDialog::handleRunModeChanged); #else - QObject::connect(_runModeButtonGroup, QOverload::of(&QButtonGroup::buttonClicked), this, &SeerDebugDialog::handleRunModeChanged); + QObject::connect(runModeTabWidget, &QTabWidget::currentChanged, this, &SeerDebugDialog::handleRunModeChanged); #endif // Set initial run mode. @@ -231,37 +225,45 @@ QString SeerDebugDialog::connectSerialParity () const { void SeerDebugDialog::setLaunchMode (const QString& mode) { if (mode == "start") { - runProgramRadioButton->click(); + + runModeTabWidget->setCurrentIndex(0); setBreakpointMode("inmain"); }else if (mode == "run") { - runProgramRadioButton->click(); + + runModeTabWidget->setCurrentIndex(0); setBreakpointMode("none"); }else if (mode == "attach") { - attachProgramRadioButton->click(); + + runModeTabWidget->setCurrentIndex(1); }else if (mode == "connect") { - connectProgramRadioButton->click(); + + runModeTabWidget->setCurrentIndex(2); }else if (mode == "corefile") { - loadCoreRadioButton->click(); + + runModeTabWidget->setCurrentIndex(3); }else if (mode == "") { - runProgramRadioButton->click(); + + runModeTabWidget->setCurrentIndex(0); setBreakpointMode("none"); }else{ + qWarning() << "Unknown launch mode of:" << mode; } } QString SeerDebugDialog::launchMode () { - if (_runModeButtonGroup->checkedId() == 1) { + if (runModeTabWidget->currentIndex() == 0) { + if (breakpointMode() == "inmain") { return "start"; }else if (breakpointMode() == "infunction") { @@ -272,17 +274,20 @@ QString SeerDebugDialog::launchMode () { return "run"; } - }else if (_runModeButtonGroup->checkedId() == 2) { + }else if (runModeTabWidget->currentIndex() == 1) { + return "attach"; - }else if (_runModeButtonGroup->checkedId() == 3) { + }else if (runModeTabWidget->currentIndex() == 2) { + return "connect"; - }else if (_runModeButtonGroup->checkedId() == 4) { + }else if (runModeTabWidget->currentIndex() == 3) { + return "corefile"; } - qWarning() << "Unknown launch mode of:" << _runModeButtonGroup->checkedId(); + qWarning() << "Unknown launch mode of:" << runModeTabWidget->currentIndex(); return ""; } @@ -353,7 +358,7 @@ void SeerDebugDialog::handleRunModeChanged (int id) { // Disable all imprortant widgets. // - // ID == 1 RUN/START + // ID == 0 RUN/START executableNameLineEdit->setEnabled(false); executableSymbolNameLineEdit->setEnabled(false); executableWorkingDirectoryLineEdit->setEnabled(false); @@ -370,12 +375,12 @@ void SeerDebugDialog::handleRunModeChanged (int id) { randomizeStartAddressCheckBox->setEnabled(false); nonStopModeCheckBox->setEnabled(false); - // ID == 2 ATTACH + // ID == 1 ATTACH attachProgramPidLabel->setEnabled(false); attachProgramPidLineEdit->setEnabled(false); attachProgramPidToolButton->setEnabled(false); - // ID == 3 CONNECT + // ID == 2 CONNECT connectProgramHostPortLabel->setEnabled(false); connectProgramHostPortLineEdit->setEnabled(false); connectProgramSerialLabel->setEnabled(false); @@ -383,7 +388,7 @@ void SeerDebugDialog::handleRunModeChanged (int id) { connectProgramParityLabel->setEnabled(false); connectProgramParityComboBox->setEnabled(false); - // ID == 4 CORE + // ID == 3 CORE loadCoreFilenameLabel->setEnabled(false); loadCoreFilenameLineEdit->setEnabled(false); loadCoreFilenameToolButton->setEnabled(false); @@ -392,8 +397,8 @@ void SeerDebugDialog::handleRunModeChanged (int id) { // Enable the newly selected one. // - // ID == 1 RUN/START - if (id == 1) { + // ID == 0 RUN/START + if (id == 0) { executableNameLineEdit->setEnabled(true); executableSymbolNameLineEdit->setEnabled(true); executableWorkingDirectoryLineEdit->setEnabled(true); @@ -411,8 +416,8 @@ void SeerDebugDialog::handleRunModeChanged (int id) { nonStopModeCheckBox->setEnabled(true); } - // ID == 2 ATTACH - if (id == 2) { + // ID == 1 ATTACH + if (id == 1) { executableNameLineEdit->setEnabled(true); executableSymbolNameLineEdit->setEnabled(true); attachProgramPidLabel->setEnabled(true); @@ -420,8 +425,8 @@ void SeerDebugDialog::handleRunModeChanged (int id) { attachProgramPidToolButton->setEnabled(true); } - // ID == 3 CONNECT - if (id == 3) { + // ID == 2 CONNECT + if (id == 2) { executableSymbolNameLineEdit->setEnabled(true); connectProgramHostPortLabel->setEnabled(true); connectProgramHostPortLineEdit->setEnabled(true); @@ -431,8 +436,8 @@ void SeerDebugDialog::handleRunModeChanged (int id) { connectProgramParityComboBox->setEnabled(true); } - // ID == 4 CORE - if (id == 4) { + // ID == 3 CORE + if (id == 3) { executableSymbolNameLineEdit->setEnabled(true); connectProgramHostPortLabel->setEnabled(true); loadCoreFilenameLabel->setEnabled(true); diff --git a/src/SeerDebugDialog.h b/src/SeerDebugDialog.h index f3496e0..2df0405 100644 --- a/src/SeerDebugDialog.h +++ b/src/SeerDebugDialog.h @@ -71,6 +71,5 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm { void handleRunModeChanged (int id); private: - QButtonGroup* _runModeButtonGroup; }; diff --git a/src/SeerDebugDialog.ui b/src/SeerDebugDialog.ui index 8de2d2c..540cdf8 100644 --- a/src/SeerDebugDialog.ui +++ b/src/SeerDebugDialog.ui @@ -6,17 +6,14 @@ 0 0 - 550 - 857 + 616 + 902 Select Executable to Debug - - - 9 - + @@ -28,48 +25,49 @@ false - - - 9 - - - - - - 0 - 0 - - - - The path and name of an executable to debug. - - - The path and name of an executable to debug. - - - true - - - - - - - - 0 - 0 - - - - Open a dialog to select an executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - + + + + + + + + 0 + 0 + + + + The path and name of an executable to debug. + + + The path and name of an executable to debug. + + + true + + + + + + + + 0 + 0 + + + + Open a dialog to select an executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + @@ -85,45 +83,49 @@ false - - - - - - 0 - 0 - - - - Optional path and name of a symbol file for the executable. - - - Optional path and name of a symbol file for the executable. - - - true - - - - - - - - 0 - 0 - - - - Open a dialog to select the symbol file for the executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - + + + + + + + + 0 + 0 + + + + Optional path and name of a symbol file for the executable. + + + Optional path and name of a symbol file for the executable. + + + true + + + + + + + + 0 + 0 + + + + Open a dialog to select the symbol file for the executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + @@ -139,33 +141,37 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - Open a dialog to select a path. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - The working directory path to tell GDB. Default current directory. - - - The working directory path to tell GDB. Default current directory. - - - true - - + + + + + + + The working directory path to tell GDB. Default current directory. + + + The working directory path to tell GDB. Default current directory. + + + true + + + + + + + Open a dialog to select a path. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + @@ -181,439 +187,529 @@ Launch Method - - - - - Run the program. - - - Run a program - - - - - - - Arguments - - - - - - - - 100 - 0 - - - - The arguments to pass to the program. - - - optional program arguments - - - true - - - - - - - Breakpoints file - - - - - - - - 100 - 0 - - - - A file containing previously saved breakpoints. - - - seer.brk - - - true - - - - - - - Open a dialog to select a breakpoints file. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - - No initial breakpoint. - - - No breakpoint - - - true - - - breakpointButtonGroup - - - - - - - Set a breakpoint in "main". - - - Break in "main" - - - breakpointButtonGroup - - - - - - - Set a breakpoint in a function or at an address. - - - Break in - - - breakpointButtonGroup - - - - - - - The breakpoint function or address. - - - - - - _function or 0xaddress - - - true - - - - - - - - - - - Show Assembly tab at startup. - - - Show Assembly tab - - - - - - - Allow other threads to continue if any thread reaches a breakpoint. - - - Non-stop mode - - - - - - - Randomize the process start address. - - - Randomize start address - - - - - - - - - Qt::Horizontal - - - - - - - Attach to an already running program. - - - Attach to a local program - - - - - - - Process PID - - - - - - - - 100 - 0 - - - - The process pid. - - - 999999 - - - pid - - - true - - - - - - - Open a dialog to select a pid on the local system. - - - ... - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 298 - 14 - - - - - - - - Qt::Horizontal - - - - - - - Connect to an already running program started with gdbserver. - - - Connect to a gdbserver running a program - - - - - - - Gdbserver - - - - - - - - 100 - 0 - - - - How to access the remote gdbserver. - - - - - - host:port or /dev/serialport - - - true - - - - - - - Serial - - - - - - - - 100 - 0 - - - - Serial port baud rate. - - - 999999 - - - baudrate - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 298 - 22 - - - - - - - - Parity - - - - - - - Serial port parity setting. - - - - none - - - - - odd - - - - - even - - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 298 - 19 - - - - - - - - Qt::Horizontal - - - - - - - Load a core file to debug. - - - Load a core file - - - - - - - Core file - - - - - - - - 100 - 0 - - - - The path and name of a core file. - - - true - - - - - - - Open a dialog to select a core file. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + 1 + + + Run + + + + + + + + Run and debug an executable. + + + + + + + + + + Arguments + + + + + + + + 100 + 0 + + + + The arguments to pass to the program. + + + optional program arguments + + + true + + + + + + + Breakpoints file + + + + + + + + 100 + 0 + + + + A file containing previously saved breakpoints. + + + seer.brk + + + true + + + + + + + Open a dialog to select a breakpoints file. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + + + + No initial breakpoint. + + + No breakpoint + + + true + + + breakpointButtonGroup + + + + + + + Set a breakpoint in "main". + + + Break in "main" + + + breakpointButtonGroup + + + + + + + Set a breakpoint in a function or at an address. + + + Break in + + + breakpointButtonGroup + + + + + + + The breakpoint function or address. + + + + + + _function or 0xaddress + + + true + + + + + + + + + + + Show Assembly tab at startup. + + + Show Assembly tab + + + + + + + Allow other threads to continue if any thread reaches a breakpoint. + + + Non-stop mode + + + + + + + Randomize the process start address. + + + Randomize start address + + + + + + + + + Qt::Vertical + + + + 20 + 318 + + + + + + + + + + + Attach + + + + + + + + Attach and debug a running process on the local machine. + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 248 + 24 + + + + + + + + + 100 + 0 + + + + The process pid. + + + 999999 + + + pid + + + true + + + + + + + Process PID + + + + + + + Qt::Vertical + + + + 20 + 418 + + + + + + + + Open a dialog to select a pid on the local system. + + + ... + + + + + + + + + + + + Connect + + + + + + + + Connect to a gdbserver (or similar) session. + + + + + + + + + + Gdbserver + + + + + + + + 100 + 0 + + + + How to access the remote gdbserver. + + + + + + host:port or /dev/serialport + + + true + + + + + + + Serial + + + + + + + + 100 + 0 + + + + Serial port baud rate. + + + 999999 + + + baudrate + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 338 + 21 + + + + + + + + Parity + + + + + + + Serial port parity setting. + + + + none + + + + + odd + + + + + even + + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 338 + 21 + + + + + + + + + + Qt::Vertical + + + + 20 + 378 + + + + + + + + + + + Corefile + + + + + + + + Analyze a corefile. + + + + + + + + + + Core file + + + + + + + + 100 + 0 + + + + The path and name of a core file. + + + true + + + + + + + Open a dialog to select a core file. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + + Qt::Vertical + + + + 20 + 478 + + + + + + + + @@ -630,11 +726,11 @@ - launchMethodGroupBox executableNameGroupBox - executableWorkingDirectoryGroupBox buttonBox executableSymbolNameGroupBox + executableWorkingDirectoryGroupBox + launchMethodGroupBox