From 97e9f113879ca23d20ab0a5f124aaff9066ffb55 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 17 Sep 2015 11:11:24 +0200 Subject: Debugger: Allow LLDB-MI to be used as debugger That's LLDB's "compatibility" mode faking a GDB 7.4 interface. This is not directly needed given Qt Creator's native LLDB support but might be a useful fallback in some setups. Change-Id: Ia2c1c731de46b8c668bb0c822f1438fe203aa9c5 Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggeritem.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 338449ee51..6195c6734f 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -110,10 +110,15 @@ void DebuggerItem::createId() void DebuggerItem::reinitializeFromFile() { - QProcess proc; // CDB only understands the single-dash -version, whereas GDB and LLDB are - // happy with both -version and --version. So use the "working" -version. - proc.start(m_command.toString(), QStringList() << QLatin1String("-version")); + // happy with both -version and --version. So use the "working" -version + // except for the experimental LLDB-MI which insists on --version. + const char *version = "-version"; + if (m_command.toFileInfo().baseName().toLower().contains(QLatin1String("lldb-mi"))) + version = "--version"; + + QProcess proc; + proc.start(m_command.toString(), QStringList({ QLatin1String(version) })); if (!proc.waitForStarted() || !proc.waitForFinished()) { m_engineType = NoEngineType; return; -- cgit v1.2.3