forked from qt-creator/qt-creator
Qnx: Modernize QnxConfiguration::assignDebuggersToTarget() a bit
FilePath, ranged for. Change-Id: I4c04fcc0e2217fa59c6cdcda2d1e5877c496d3e7 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -443,20 +443,18 @@ void QnxConfiguration::updateTargets()
|
|||||||
|
|
||||||
void QnxConfiguration::assignDebuggersToTargets()
|
void QnxConfiguration::assignDebuggersToTargets()
|
||||||
{
|
{
|
||||||
const QDir hostUsrBinDir(m_qnxHost.pathAppended("usr/bin").toString());
|
const FilePath hostUsrBinDir = m_qnxHost.pathAppended("usr/bin");
|
||||||
QStringList debuggerNames = hostUsrBinDir.entryList(
|
FilePaths debuggerNames = hostUsrBinDir.dirEntries(
|
||||||
QStringList(HostOsInfo::withExecutableSuffix(QLatin1String("nto*-gdb"))),
|
QStringList(HostOsInfo::withExecutableSuffix("nto*-gdb")),
|
||||||
QDir::Files);
|
QDir::Files);
|
||||||
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
|
Environment sysEnv = Environment::systemEnvironment();
|
||||||
sysEnv.modify(qnxEnvironmentItems());
|
sysEnv.modify(qnxEnvironmentItems());
|
||||||
foreach (const QString &debuggerName, debuggerNames) {
|
for (const FilePath &debuggerPath : debuggerNames) {
|
||||||
const FilePath debuggerPath = FilePath::fromString(hostUsrBinDir.path())
|
|
||||||
.pathAppended(debuggerName);
|
|
||||||
DebuggerItem item;
|
DebuggerItem item;
|
||||||
item.setCommand(debuggerPath);
|
item.setCommand(debuggerPath);
|
||||||
item.reinitializeFromFile(sysEnv);
|
item.reinitializeFromFile(sysEnv);
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (const Abi &abi, item.abis()) {
|
for (const Abi &abi : item.abis()) {
|
||||||
for (Target &target : m_targets) {
|
for (Target &target : m_targets) {
|
||||||
if (target.m_abi.isCompatibleWith(abi)) {
|
if (target.m_abi.isCompatibleWith(abi)) {
|
||||||
found = true;
|
found = true;
|
||||||
@@ -472,7 +470,7 @@ void QnxConfiguration::assignDebuggersToTargets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
qWarning() << "No target found for" << debuggerName << "... discarded";
|
qWarning() << "No target found for" << debuggerPath.toUserOutput() << "... discarded";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user