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

Method execInferior

plugins/lldb/debugsession.cpp:220–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220bool DebugSession::execInferior(ILaunchConfiguration *cfg, IExecutePlugin *, const QString &)
221{
222 qCDebug(DEBUGGERLLDB) << "Executing inferior";
223
224 KConfigGroup grp = cfg->config();
225
226 // Start inferior
227 bool remoteDebugging = grp.readEntry(Config::LldbRemoteDebuggingEntry, false);
228 QUrl configLldbScript = grp.readEntry(Config::LldbConfigScriptEntry, QUrl());
229 addCommand(std::make_unique<SentinelCommand>(
230 [this, remoteDebugging, configLldbScript]() {
231 // setup inferior I/O redirection
232 if (!remoteDebugging) {
233 // FIXME: a hacky way to emulate tty setting on linux. Not sure if this provides all needed
234 // functionalities of a pty. Should make this conditional on other platforms.
235
236 // no need to quote, settings set takes 'raw' input
237 addCommand(MI::NonMI, QStringLiteral("settings set target.input-path %0").arg(m_tty->getSlave()));
238 addCommand(MI::NonMI, QStringLiteral("settings set target.output-path %0").arg(m_tty->getSlave()));
239 addCommand(MI::NonMI, QStringLiteral("settings set target.error-path %0").arg(m_tty->getSlave()));
240 } else {
241 // what is the expected behavior for using external terminal when doing remote debugging?
242 }
243
244 // send breakpoints already in our breakpoint model to lldb
245 auto bc = breakpointController();
246 bc->initSendBreakpoints();
247
248 qCDebug(DEBUGGERLLDB) << "Turn on delete duplicate mode";
249 // turn on delete duplicate breakpoints model, so that breakpoints created by user command in
250 // the script and returned as a =breakpoint-created notification won't get duplicated with the
251 // one already in our model.
252 // we will turn this model off once we first reach a paused state, and from that time on,
253 // the user can create duplicated breakpoints using normal command.
254 bc->setDeleteDuplicateBreakpoints(true);
255 // run custom config script right before we starting the inferior,
256 // so the user has the freedom to change everything.
257 if (configLldbScript.isValid()) {
258 addCommand(MI::NonMI,
259 QLatin1String("command source -s 0 ") + KShell::quoteArg(configLldbScript.toLocalFile()));
260 }
261
262 addCommand(MI::ExecRun, QString(), new ExecRunHandler(this), CmdMaybeStartsRunning | CmdHandlesError);
263 },
264 CmdMaybeStartsRunning));
265 return true;
266}
267
268void DebugSession::loadCoreFile(const QString& coreFile)
269{

Callers

nothing calls this directly

Calls 10

breakpointControllerFunction · 0.85
readEntryMethod · 0.80
getSlaveMethod · 0.80
initSendBreakpointsMethod · 0.80
toLocalFileMethod · 0.80
QUrlClass · 0.50
QStringClass · 0.50
configMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected