forked from qt-creator/qt-creator
AppMan: Various small fixes
* Always use the correct symbol when debugging * Fix the TargetInformation::isValid() function * Optimize RunConfigurationFactory::supportsBuildKey() Change-Id: I5f007d5c216ff9808adf9f8b878c9cbc9f47e3eb Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -86,10 +86,8 @@ public:
|
||||
|
||||
virtual bool supportsBuildKey(Target *target, const QString &key) const final
|
||||
{
|
||||
QList<TargetInformation> tis = TargetInformation::readFromProject(target);
|
||||
return Utils::anyOf(tis, [key](const TargetInformation &ti) {
|
||||
return ti.buildKey == key;
|
||||
});
|
||||
QList<TargetInformation> tis = TargetInformation::readFromProject(target, key);
|
||||
return !tis.isEmpty();
|
||||
}
|
||||
|
||||
virtual bool filterTarget(const TargetInformation &ti) const
|
||||
|
@@ -193,7 +193,7 @@ private:
|
||||
class AppManagerDebugSupport final : public Debugger::DebuggerRunTool
|
||||
{
|
||||
private:
|
||||
QString m_symbolFile;
|
||||
FilePath m_symbolFile;
|
||||
AppManInferiorRunner *m_debuggee = nullptr;
|
||||
|
||||
public:
|
||||
@@ -217,14 +217,13 @@ public:
|
||||
return;
|
||||
|
||||
if (targetInformation.manifest.isQmlRuntime()) {
|
||||
const Utils::FilePath dir = SysRootKitAspect::sysRoot(target->kit());
|
||||
// TODO: get real aspect from deploy configuration
|
||||
QString amfolder = Constants::REMOTE_DEFAULT_BIN_PATH;
|
||||
m_symbolFile = dir.toString() + amfolder + QDir::separator() + Constants::APPMAN_LAUNCHER_QML;
|
||||
m_symbolFile = getToolFilePath(Constants::APPMAN_LAUNCHER_QML,
|
||||
target->kit(),
|
||||
DeviceKitAspect::device(target->kit()));
|
||||
} else if (targetInformation.manifest.isNativeRuntime()) {
|
||||
m_symbolFile = Utils::findOrDefault(target->buildSystem()->applicationTargets(), [&](const BuildTargetInfo &ti) {
|
||||
return ti.buildKey == targetInformation.manifest.code || ti.projectFilePath.toString() == targetInformation.manifest.code;
|
||||
}).targetFilePath.toString();
|
||||
}).targetFilePath;
|
||||
} else {
|
||||
reportFailure(Tr::tr("Cannot debug: Only QML and native applications are supported."));
|
||||
}
|
||||
@@ -249,7 +248,7 @@ private:
|
||||
setUseContinueInsteadOfRun(true);
|
||||
setContinueAfterAttach(true);
|
||||
setRemoteChannel(m_debuggee->gdbServer());
|
||||
setSymbolFile(FilePath::fromString(m_symbolFile));
|
||||
setSymbolFile(m_symbolFile);
|
||||
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(runControl()->kit());
|
||||
if (version) {
|
||||
|
@@ -48,6 +48,7 @@ QList<TargetInformation> TargetInformation::readFromProject(const Target *target
|
||||
const Utils::expected_str<QByteArray> localFileContents = manifestFilePath.fileContents();
|
||||
if (!localFileContents.has_value()) {
|
||||
qWarning() << "NOPE:" << localFileContents.error();
|
||||
continue;
|
||||
}
|
||||
|
||||
auto createTargetInformation = [buildKey, manifestFilePath, cmakeTarget, packageFilePath, isBuiltinPackage, &result](const YAML::Node &document) {
|
||||
@@ -131,7 +132,7 @@ TargetInformation::TargetInformation(const Target *target)
|
||||
|
||||
bool TargetInformation::isValid() const
|
||||
{
|
||||
return !manifest.filePath.isEmpty() && packageFilePath.isFile();
|
||||
return !manifest.filePath.isEmpty() && manifest.filePath.isFile();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user