| 180 | } |
| 181 | |
| 182 | void MainWindow::debugExportFile(const QString &filename) { |
| 183 | if (filename.isEmpty()) { |
| 184 | return; |
| 185 | } |
| 186 | int i; |
| 187 | |
| 188 | QSettings info(filename, QSettings::IniFormat); |
| 189 | |
| 190 | // Set the file format version |
| 191 | info.setValue(QStringLiteral("version"), VERSION_DBG); |
| 192 | |
| 193 | // Save the breakpoint information |
| 194 | QStringList breakLabel; |
| 195 | QStringList breakAddr; |
| 196 | QStringList breakSet; |
| 197 | for(i = 0; i < m_breakpoints->rowCount(); i++) { |
| 198 | if (m_breakpoints->item(i, BREAK_ADDR_COL)->text() != DEBUG_UNSET_ADDR) { |
| 199 | breakLabel.append(m_breakpoints->item(i, BREAK_NAME_COL)->text()); |
| 200 | breakAddr.append(m_breakpoints->item(i, BREAK_ADDR_COL)->text()); |
| 201 | breakSet.append(static_cast<QAbstractButton *>(m_breakpoints->cellWidget(i, BREAK_ENABLE_COL))->isChecked() ? TXT_YES : TXT_NO); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | info.setValue(QStringLiteral("breakpoints/label"), breakLabel); |
| 206 | info.setValue(QStringLiteral("breakpoints/address"), breakAddr); |
| 207 | info.setValue(QStringLiteral("breakpoints/enable"), breakSet); |
| 208 | |
| 209 | // Save watchpoint information |
| 210 | QStringList watchLabel; |
| 211 | QStringList watchLow; |
| 212 | QStringList watchHigh; |
| 213 | QStringList watchR; |
| 214 | QStringList watchW; |
| 215 | for(i = 0; i < m_watchpoints->rowCount(); i++) { |
| 216 | if (m_watchpoints->item(i, WATCH_LOW_COL)->text() != DEBUG_UNSET_ADDR) { |
| 217 | watchLabel.append(m_watchpoints->item(i, WATCH_NAME_COL)->text()); |
| 218 | watchLow.append(m_watchpoints->item(i, WATCH_LOW_COL)->text()); |
| 219 | watchHigh.append(m_watchpoints->item(i, WATCH_HIGH_COL)->text()); |
| 220 | watchR.append(static_cast<QAbstractButton *>(m_watchpoints->cellWidget(i, WATCH_READ_COL))->isChecked() ? TXT_YES : TXT_NO); |
| 221 | watchW.append(static_cast<QAbstractButton *>(m_watchpoints->cellWidget(i, WATCH_WRITE_COL))->isChecked() ? TXT_YES : TXT_NO); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | info.setValue(QStringLiteral("watchpoints/label"), watchLabel); |
| 226 | info.setValue(QStringLiteral("watchpoints/low"), watchLow); |
| 227 | info.setValue(QStringLiteral("watchpoints/high"), watchHigh); |
| 228 | info.setValue(QStringLiteral("watchpoints/read"), watchR); |
| 229 | info.setValue(QStringLiteral("watchpoints/write"), watchW); |
| 230 | |
| 231 | // Save port monitor information |
| 232 | QStringList portAddr; |
| 233 | QStringList portR; |
| 234 | QStringList portW; |
| 235 | QStringList portF; |
| 236 | for(i = 0; i < m_ports->rowCount(); i++) { |
| 237 | if (m_ports->item(i, PORT_ADDR_COL)->text() != DEBUG_UNSET_PORT) { |
| 238 | portAddr.append(m_ports->item(i, PORT_ADDR_COL)->text()); |
| 239 | portR.append(static_cast<QAbstractButton *>(m_ports->cellWidget(i, PORT_READ_COL))->isChecked() ? TXT_YES : TXT_NO); |