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

Method attachToProcess

plugins/debuggercommon/midebugsession.cpp:350–379  ·  view source on GitHub ↗

FIXME: use same configuration process as startDebugging

Source from the content-addressed store, hash-verified

348
349// FIXME: use same configuration process as startDebugging
350bool MIDebugSession::attachToProcess(int pid)
351{
352 qCDebug(DEBUGGERCOMMON) << "Attach to process" << pid;
353
354 emit showMessage(i18n("Attaching to process %1", pid), 1000);
355
356 if (debuggerStateIsOn(s_dbgNotStarted)) {
357 // FIXME: use global launch configuration rather than nullptr
358 if (!startDebugger(nullptr)) {
359 return false;
360 }
361 }
362
363 setDebuggerStateOn(s_attached);
364
365 //set current state to running, after attaching we will get *stopped response
366 setDebuggerStateOn(s_appRunning);
367
368 addCommand(TargetAttach, QString::number(pid),
369 this, &MIDebugSession::handleTargetAttach,
370 CmdHandlesError);
371
372 addCommand(std::make_unique<SentinelCommand>(breakpointController(), &MIBreakpointController::initSendBreakpoints));
373
374 raiseEvent(connected_to_program);
375
376 emit raiseFramestackViews();
377
378 return true;
379}
380
381void MIDebugSession::handleTargetAttach(const MI::ResultRecord& r)
382{

Callers 3

testAttachMethod · 0.80
startMethod · 0.80
testAttachMethod · 0.80

Calls 1

breakpointControllerFunction · 0.85

Tested by 2

testAttachMethod · 0.64
testAttachMethod · 0.64