diff --git a/CHANGELOG.md b/CHANGELOG.md index 790b495..ba9b605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * The Pending flag is automatically supplied to the breakpoint function in the Debug dialog for the Run mode. Some apps use deferred loading of code with dlopen(). +* Fixed bug when restoring from project file with 'start' mode. ## [1.15] - 2023-03-04 * Revamp Debug dialog. Move debug modes into "tabs". diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp index ae3841f..1d4ecff 100644 --- a/src/SeerDebugDialog.cpp +++ b/src/SeerDebugDialog.cpp @@ -485,30 +485,56 @@ void SeerDebugDialog::loadProject (const QString& filename, bool notify) { // Load RUN/START project. if (runModeJson.isEmpty() == false || startModeJson.isEmpty() == false) { - runProgramArgumentsLineEdit->setText(runModeJson["arguments"].toString()); - loadBreakpointsFilenameLineEdit->setText(runModeJson["breakpointsfile"].toString()); - - if (runModeJson["nobreak"].toBool()) { - noBreakpointRadioButton->setChecked(true); - } - - if (runModeJson["breakinmain"].toBool()) { - breakpointInMainRadioButton->setChecked(true); - } - - if (runModeJson["breakinfunction"].toBool()) { - breakpointInFunctionRadioButton->setChecked(true); - } - breakpointInFunctionLineEdit->setText(runModeJson["breakinfunctionname"].toString()); - - showAsseblyTabCheckBox->setChecked(runModeJson["showassemblytab"].toBool()); - nonStopModeCheckBox->setChecked(runModeJson["nonstopmode"].toBool()); - randomizeStartAddressCheckBox->setChecked(runModeJson["randomizestartaddress"].toBool()); - if (runModeJson.isEmpty() == false) { + + runProgramArgumentsLineEdit->setText(runModeJson["arguments"].toString()); + loadBreakpointsFilenameLineEdit->setText(runModeJson["breakpointsfile"].toString()); + + if (runModeJson["nobreak"].toBool()) { + noBreakpointRadioButton->setChecked(true); + } + + if (runModeJson["breakinmain"].toBool()) { + breakpointInMainRadioButton->setChecked(true); + } + + if (runModeJson["breakinfunction"].toBool()) { + breakpointInFunctionRadioButton->setChecked(true); + } + + breakpointInFunctionLineEdit->setText(runModeJson["breakinfunctionname"].toString()); + showAsseblyTabCheckBox->setChecked(runModeJson["showassemblytab"].toBool()); + nonStopModeCheckBox->setChecked(runModeJson["nonstopmode"].toBool()); + randomizeStartAddressCheckBox->setChecked(runModeJson["randomizestartaddress"].toBool()); + setLaunchMode("run"); - }else{ + + }else if (startModeJson.isEmpty() == false) { + + runProgramArgumentsLineEdit->setText(startModeJson["arguments"].toString()); + loadBreakpointsFilenameLineEdit->setText(startModeJson["breakpointsfile"].toString()); + + if (startModeJson["nobreak"].toBool()) { + noBreakpointRadioButton->setChecked(true); + } + + if (startModeJson["breakinmain"].toBool()) { + breakpointInMainRadioButton->setChecked(true); + } + + if (startModeJson["breakinfunction"].toBool()) { + breakpointInFunctionRadioButton->setChecked(true); + } + + breakpointInFunctionLineEdit->setText(startModeJson["breakinfunctionname"].toString()); + showAsseblyTabCheckBox->setChecked(startModeJson["showassemblytab"].toBool()); + nonStopModeCheckBox->setChecked(startModeJson["nonstopmode"].toBool()); + randomizeStartAddressCheckBox->setChecked(startModeJson["randomizestartaddress"].toBool()); + setLaunchMode("start"); + + }else{ + setLaunchMode(""); } }