aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-03-11 14:01:35 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2020-03-16 11:13:32 +0000
commita102c11d003928dcad2f9ce41c1f507320bc1d1a (patch)
treead9d751cb65965af3c1b95e5c9987cc775176b19 /src
parent9295bfe3e47a83aa32b7d18f4f0082714528ab27 (diff)
Qmake: Add some debug output for file add/remove operations
This will help collecting feedback from users affected by bugs. Task-number: QTCREATORBUG-22508 Change-Id: Idfc22245587dd2d71b229b4ab6c7562fb7a5ecfc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp3
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp4
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.h2
-rw-r--r--src/shared/proparser/prowriter.cpp13
4 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index 59f22e4faa..25397d92d6 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -217,6 +217,9 @@ bool QmakeBuildSystem::addFiles(Node *context, const QStringList &filePaths, QSt
actualFilePaths.removeOne(e);
if (notAdded)
*notAdded = alreadyPresentFiles;
+ qCDebug(qmakeNodesLog) << Q_FUNC_INFO << "file paths:" << filePaths
+ << "already present:" << alreadyPresentFiles
+ << "actual file paths:" << actualFilePaths;
return pri->addFiles(actualFilePaths, notAdded);
}
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
index f3d20cb894..068fb5d703 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
@@ -107,6 +107,8 @@ uint qHash(FileOrigin fo) { return ::qHash(int(fo)); }
namespace Internal {
+Q_LOGGING_CATEGORY(qmakeNodesLog, "qtc.qmake.nodes", QtWarningMsg)
+
class QmakeEvalInput
{
public:
@@ -901,6 +903,8 @@ void QmakePriFile::changeFiles(const QString &mimeType,
if (!includeFile)
return;
+ qCDebug(qmakeNodesLog) << Q_FUNC_INFO << "mime type:" << mimeType << "file paths:"
+ << filePaths << "change type:" << int(change) << "mode:" << int(mode);
if (change == AddToProFile) {
// Use the first variable for adding.
ProWriter::addFiles(includeFile, &lines, filePaths, varNameForAdding(mimeType),
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
index 0812e16255..c1029bde85 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
@@ -35,6 +35,7 @@
#include <QFutureWatcher>
#include <QHash>
+#include <QLoggingCategory>
#include <QMap>
#include <QPair>
#include <QStringList>
@@ -108,6 +109,7 @@ enum class Variable {
uint qHash(Variable key, uint seed = 0);
namespace Internal {
+Q_DECLARE_LOGGING_CATEGORY(qmakeNodesLog)
class QmakeEvalInput;
class QmakeEvalResult;
class QmakePriFileEvalResult;
diff --git a/src/shared/proparser/prowriter.cpp b/src/shared/proparser/prowriter.cpp
index 6d79524912..52d49751f2 100644
--- a/src/shared/proparser/prowriter.cpp
+++ b/src/shared/proparser/prowriter.cpp
@@ -30,9 +30,12 @@
#include <utils/algorithm.h>
#include <QDir>
+#include <QLoggingCategory>
#include <QPair>
#include <QRegularExpression>
+Q_LOGGING_CATEGORY(prowriterLog, "qtc.prowriter", QtWarningMsg)
+
using namespace QmakeProjectManager::Internal;
static uint getBlockLen(const ushort *&tokPtr)
@@ -309,6 +312,9 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
const QString &var, PutFlags flags, const QString &scope,
const QString &continuationIndent)
{
+ qCDebug(prowriterLog) << Q_FUNC_INFO << "lines:" << *lines << "values:" << values
+ << "var:" << var << "flags:" << int(flags) << "scope:" << scope
+ << "indent:" << continuationIndent;
const QString indent = scope.isEmpty() ? QString() : continuationIndent;
const auto effectiveContIndent = [indent, continuationIndent](const ContinuationInfo &ci) {
return !ci.indent.isEmpty() ? ci.indent : continuationIndent + indent;
@@ -325,10 +331,12 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
if (eqs >= 0) // If this is not true, we mess up the file a bit.
line.truncate(eqs + 1);
// put new values
+ qCDebug(prowriterLog) << 1 << "old line value:" << line;
for (const QString &v : values) {
line += ((flags & MultiLine) ? QString(" \\\n") + effectiveContIndent(contInfo)
: QString(" ")) + v;
}
+ qCDebug(prowriterLog) << "new line value:" << line;
} else {
const ContinuationInfo contInfo = skipContLines(lines, lineNo, false);
int endLineNo = contInfo.lineNo;
@@ -343,6 +351,8 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
} else {
newLine += " \\";
}
+ qCDebug(prowriterLog) << 2 << "adding new line" << newLine
+ << "at line " << curLineNo;
lines->insert(curLineNo, newLine);
++endLineNo;
}
@@ -360,8 +370,10 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
const QRegularExpression rx("\\A(\\s*" + scope + "\\s*:\\s*)[^\\s{].*\\z");
const QRegularExpressionMatch match(rx.match(lines->at(scopeStart)));
if (match.hasMatch()) {
+ qCDebug(prowriterLog) << 3 << "old line value:" << (*lines)[scopeStart];
(*lines)[scopeStart].replace(0, match.captured(1).length(),
scope + " {\n" + continuationIndent);
+ qCDebug(prowriterLog) << "new line value:" << (*lines)[scopeStart];
contInfo = skipContLines(lines, scopeStart, false);
lNo = contInfo.lineNo;
scopeStart = -1;
@@ -395,6 +407,7 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
}
if (!scope.isEmpty() && scopeStart < 0)
added += "\n}";
+ qCDebug(prowriterLog) << 4 << "adding" << added << "at line" << lNo;
lines->insert(lNo, added);
}
}