| 250 | |
| 251 | #if HAVE_KSYSGUARD |
| 252 | void MIDebuggerPlugin::slotAttachProcess() |
| 253 | { |
| 254 | showStatusMessage(i18n("Choose a process to attach to..."), 1000); |
| 255 | |
| 256 | if (!core()->debugController()->canAddSession(replaceSessionQuestionText())) { |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | const auto pid = askUserForProcessId(core()->uiController()->activeMainWindow()); |
| 261 | if (pid == 0) { |
| 262 | return; |
| 263 | } |
| 264 | |
| 265 | // TODO: move check into process selection dialog |
| 266 | if (QApplication::applicationPid() == pid) { |
| 267 | const QString messageText = |
| 268 | i18n("Not attaching to process %1: cannot attach the debugger to itself.", pid); |
| 269 | auto* message = new Sublime::Message(messageText, Sublime::Message::Error); |
| 270 | ICore::self()->uiController()->postMessage(message); |
| 271 | } |
| 272 | else |
| 273 | attachProcess(pid); |
| 274 | } |
| 275 | #endif |
| 276 | |
| 277 | MIAttachProcessJob* MIDebuggerPlugin::attachProcess(int pid) |
nothing calls this directly
no test coverage detected