MCPcopy Create free account
hub / github.com/KDE/kdevelop / slotAttachProcess

Method slotAttachProcess

plugins/debuggercommon/midebuggerplugin.cpp:252–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250
251#if HAVE_KSYSGUARD
252void 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
277MIAttachProcessJob* MIDebuggerPlugin::attachProcess(int pid)

Callers

nothing calls this directly

Calls 5

canAddSessionMethod · 0.80
debugControllerMethod · 0.80
uiControllerMethod · 0.80
activeMainWindowMethod · 0.45
postMessageMethod · 0.45

Tested by

no test coverage detected