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

Method start

plugins/lldb/lldbdebugger.cpp:36–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool LldbDebugger::start(KConfigGroup& config, const QStringList& extraArguments)
37{
38 // Get path to executable
39 QUrl lldbUrl = config.readEntry(Config::LldbExecutableEntry, QUrl());
40 if (!lldbUrl.isValid() || !lldbUrl.isLocalFile()) {
41 m_debuggerExecutable = QStringLiteral("lldb-mi");
42 } else {
43 m_debuggerExecutable = lldbUrl.toLocalFile();
44 }
45
46 // Get arguments
47 QStringList arguments = extraArguments;
48 //arguments << "-quiet";
49 arguments.append(KShell::splitArgs(config.readEntry(Config::LldbArgumentsEntry, QString())));
50
51 // Get environment
52 const EnvironmentProfileList egl(config.config());
53 const auto &envs = egl.variables(config.readEntry(Config::LldbEnvironmentEntry, egl.defaultProfileName()));
54 QProcessEnvironment processEnv;
55 if (config.readEntry(Config::LldbInheritSystemEnvEntry, true)) {
56 processEnv = QProcessEnvironment::systemEnvironment();
57 }
58 for (auto it = envs.begin(), ite = envs.end(); it != ite; ++it) {
59 processEnv.insert(it.key(), it.value());
60 }
61
62 // Start!
63 m_process->setProcessEnvironment(processEnv);
64 m_process->setProgram(m_debuggerExecutable, arguments);
65 ICore::self()->runtimeController()->currentRuntime()->startProcess(m_process);
66
67 qCDebug(DEBUGGERLLDB) << "Starting LLDB with command" << m_debuggerExecutable + QLatin1Char(' ') + arguments.join(QLatin1Char(' '));
68 qCDebug(DEBUGGERLLDB) << "LLDB process pid:" << m_process->processId();
69 emit userCommandOutput(m_debuggerExecutable + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')) + QLatin1Char('\n'));
70
71 return true;
72}
73
74#include "moc_lldbdebugger.cpp"

Callers 2

testAttachMethod · 0.45
testRemoteDebuggingMethod · 0.45

Calls 15

readEntryMethod · 0.80
isLocalFileMethod · 0.80
toLocalFileMethod · 0.80
defaultProfileNameMethod · 0.80
currentRuntimeMethod · 0.80
runtimeControllerMethod · 0.80
joinMethod · 0.80
QUrlClass · 0.50
QStringClass · 0.50
isValidMethod · 0.45
appendMethod · 0.45
configMethod · 0.45

Tested by 2

testAttachMethod · 0.36
testRemoteDebuggingMethod · 0.36