Debugger: Restrict the file name pattern of potential lldb executables

We now try executables such as lldb-7 or lldb-1024, but not e.g. lldb-
vscode, which used to time out the autodetection code.

Change-Id: Iac3b6c4d55d34ee98073f99c8e8341011845ca92
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-04-01 14:30:49 +02:00
parent ad889d6707
commit 3726218b5e

View File

@@ -702,7 +702,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
{
const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
"gdb.exe", "lldb", "lldb.exe", "lldb-*"};
"gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*"};
// DebuggerItem result;
// result.setAutoDetected(true);
@@ -748,15 +748,9 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
dir.setFilter(QDir::Files | QDir::Executable);
foreach (const Utils::FileName &base, path) {
dir.setPath(base.toFileInfo().absoluteFilePath());
foreach (const QString &entry, dir.entryList()) {
if (entry.startsWith("lldb-platform-")
|| entry.startsWith("lldb-gdbserver-")
|| entry.startsWith("lldb-mi-")) {
continue;
}
foreach (const QString &entry, dir.entryList())
suspects.append(FileName::fromString(dir.absoluteFilePath(entry)));
}
}
foreach (const FileName &command, suspects) {
const auto commandMatches = [command](const DebuggerTreeItem *titem) {