| 178 | } |
| 179 | |
| 180 | bool DebugManager::command(const QString &cmd, bool interrupt) |
| 181 | { |
| 182 | bool restart = false; |
| 183 | if (d->debugger->isInferiorRunning()) { |
| 184 | if(!interrupt) |
| 185 | return false; |
| 186 | pauseDebugger(); |
| 187 | restart = true; |
| 188 | } |
| 189 | |
| 190 | auto tokStr = QString{"%1"}.arg(d->tokenCounter, 6, 10, QChar{'0'}); |
| 191 | auto line = QString{"%1%2%3"}.arg(tokStr, cmd, "\n"); |
| 192 | d->tokenCounter = (d->tokenCounter + 1) % 999999; |
| 193 | d->process->write(line.toLocal8Bit()); |
| 194 | d->process->waitForBytesWritten(); |
| 195 | QString sOut; |
| 196 | QTextStream(&sOut) << "Command:" << line << "\n"; |
| 197 | d->debugger->handleOutputStreamText(sOut); |
| 198 | |
| 199 | if (restart) |
| 200 | commandContinue(); |
| 201 | |
| 202 | return true; |
| 203 | } |
| 204 | |
| 205 | void DebugManager::commandAndResponse(const QString& cmd, |
| 206 | const ResponseEntry::ResponseHandler_t& handler, |
no test coverage detected