Debugger: Drop clang and llvm revision from LLDB version number

They are mentioned as separate lines in the lldb --version output
for self-build lldb binaries.

Change-Id: Ib0d6e46874ad5b576ac20a6aeab823d51571c0f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-09-07 12:03:10 +02:00
parent 9055cb9843
commit 79010891e1

View File

@@ -224,12 +224,14 @@ void DebuggerItem::reinitializeFromFile()
m_abis = Abi::abisOfBinary(m_command); m_abis = Abi::abisOfBinary(m_command);
// Version // Version
if (output.startsWith(("lldb version "))) { // Linux typically. // Self-build binaries also emit clang and llvm revision.
const QString line = output.split('\n')[0];
if (line.startsWith(("lldb version "))) { // Linux typically.
int pos1 = int(strlen("lldb version ")); int pos1 = int(strlen("lldb version "));
int pos2 = output.indexOf(' ', pos1); int pos2 = line.indexOf(' ', pos1);
m_version = output.mid(pos1, pos2 - pos1); m_version = line.mid(pos1, pos2 - pos1);
} else if (output.startsWith("lldb-") || output.startsWith("LLDB-")) { // Mac typically. } else if (line.startsWith("lldb-") || line.startsWith("LLDB-")) { // Mac typically.
m_version = output.mid(5); m_version = line.mid(5);
} }
return; return;
} }