Merge remote-tracking branch 'origin/4.4' into 4.5

Change-Id: I9b7cb3d845628abf69a73a279f5a79202c0976c2
This commit is contained in:
Orgad Shaneh
2017-10-04 16:10:51 +03:00
19 changed files with 1686 additions and 1571 deletions

66
dist/changes-4.4.1.md vendored Normal file
View File

@@ -0,0 +1,66 @@
Qt Creator version 4.4.1 contains bug fixes.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v4.4.0..v4.4.1
FakeVim
* Fixed recognition of shortened `tabnext` and `tabprevious` commands
(QTCREATORBUG-18843)
All Projects
* Fixed `Add Existing Files` for top-level project nodes (QTCREATORBUG-18896)
C++ Support
* Improved handling of parsing failures (QTCREATORBUG-18864)
* Fixed crash with invalid raw string literal (QTCREATORBUG-18941)
* Fixed that code model did not use sysroot as reported from the build system
(QTCREATORBUG-18633)
* Fixed highlighting of `float` in C files (QTCREATORBUG-18879)
* Fixed `Convert to Camel Case` (QTCREATORBUG-18947)
Debugging
* Fixed that custom `solib-search-path` startup commands were ignored
(QTCREATORBUG-18812)
* Fixed `Run in terminal` when debugging external application
(QTCREATORBUG-18912)
* Fixed pretty printing of `CHAR` and `WCHAR`
Clang Static Analyzer
* Fixed options passed to analyzer on Windows
Qt Quick Designer
* Fixed usage of `shift` modifier when reparenting layouts
SCXML Editor
* Fixed eventless transitions (QTCREATORBUG-18345)
Test Integration
* Fixed test result output when debugging
Platform Specific
Windows
* Fixed auto-detection of CMake 3.9 and later
Android
* Fixed issues with new Android SDK (26.1.1) (QTCREATORBUG-18962)
* Fixed search path for QML modules when debugging
QNX
* Fixed debugging (QTCREATORBUG-18804, QTCREATORBUG-17901)
* Fixed QML profiler startup (QTCREATORBUG-18954)

View File

@@ -4,6 +4,8 @@ import qbs.FileInfo
Module {
Depends { name: "qtc" }
property bool priority: 1 // TODO: Remove declaration after 1.11 is out.
property bool enableUnitTests: false
property bool enableProjectFileUpdates: true
property bool installApiHeaders: false

View File

@@ -67,6 +67,7 @@ source_include_patterns = [
r"^doc/.*$", # include everything under doc/
r"^.*\.pri$", # .pri files in all directories that are looked into
r"^.*\.h$", # .h files in all directories that are looked into
r"^.*\.hpp$" # .hpp files in all directories that are looked into
]
build_include_patterns = [

View File

@@ -321,7 +321,7 @@ private:
inline int consumeToken() {
if (_index < int(_tokens.size()))
return _index++;
return _tokens.size() - 1;
return static_cast<int>(_tokens.size()) - 1;
}
inline const Token &tokenAt(int index) const {
if (index == 0)
@@ -468,30 +468,30 @@ Parser::Parser(Engine *engine, const char *source, unsigned size, int variant)
switch (tk.kind) {
case T_LEFT_PAREN:
parenStack.push(_tokens.size());
parenStack.push(static_cast<int>(_tokens.size()));
break;
case T_LEFT_BRACKET:
bracketStack.push(_tokens.size());
bracketStack.push(static_cast<int>(_tokens.size()));
break;
case T_LEFT_BRACE:
braceStack.push(_tokens.size());
braceStack.push(static_cast<int>(_tokens.size()));
break;
case T_RIGHT_PAREN:
if (! parenStack.empty()) {
_tokens[parenStack.top()].matchingBrace = _tokens.size();
_tokens[parenStack.top()].matchingBrace = static_cast<int>(_tokens.size());
parenStack.pop();
}
break;
case T_RIGHT_BRACKET:
if (! bracketStack.empty()) {
_tokens[bracketStack.top()].matchingBrace = _tokens.size();
_tokens[bracketStack.top()].matchingBrace = static_cast<int>(_tokens.size());
bracketStack.pop();
}
break;
case T_RIGHT_BRACE:
if (! braceStack.empty()) {
_tokens[braceStack.top()].matchingBrace = _tokens.size();
_tokens[braceStack.top()].matchingBrace = static_cast<int>(_tokens.size());
braceStack.pop();
}
break;
@@ -519,9 +519,13 @@ AST *Parser::parse(int startToken)
_recovered = false;
_tos = -1;
_startToken.kind = startToken;
int recoveryAttempts = 0;
do {
again:
recoveryAttempts = 0;
againAfterRecovery:
if (unsigned(++_tos) == _stateStack.size()) {
_stateStack.resize(_tos * 2);
_locationStack.resize(_tos * 2);
@@ -564,6 +568,7 @@ AST *Parser::parse(int startToken)
reduce(ruleno);
action = nt_action(_stateStack[_tos], lhs[ruleno] - TERMINAL_COUNT);
} else if (action == 0) {
++recoveryAttempts;
const int line = _tokens[yyloc].line + 1;
QString message = QLatin1String("Syntax error");
if (yytoken != -1) {
@@ -574,7 +579,7 @@ AST *Parser::parse(int startToken)
for (; _tos; --_tos) {
const int state = _stateStack[_tos];
static int tks[] = {
static int tks1[] = {
T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET,
T_SEMICOLON, T_COLON, T_COMMA,
T_NUMBER, T_TYPE_NAME, T_IDENTIFIER,
@@ -582,6 +587,16 @@ AST *Parser::parse(int startToken)
T_WHILE,
0
};
static int tks2[] = {
T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET,
T_SEMICOLON, T_COLON, T_COMMA,
0
};
int *tks;
if (recoveryAttempts < 2)
tks = tks1;
else
tks = tks2; // Avoid running into an endless loop for e.g.: for(int x=0; x y
for (int *tptr = tks; *tptr; ++tptr) {
const int next = t_action(state, *tptr);
@@ -604,7 +619,7 @@ AST *Parser::parse(int startToken)
yytoken = -1;
action = next;
goto again;
goto againAfterRecovery;
}
}
}

View File

@@ -1,5 +1,5 @@
#line 423 "./glsl.g"
#line 413 "./glsl.g"
/****************************************************************************
**
@@ -109,9 +109,13 @@ AST *Parser::parse(int startToken)
_recovered = false;
_tos = -1;
_startToken.kind = startToken;
int recoveryAttempts = 0;
do {
again:
recoveryAttempts = 0;
againAfterRecovery:
if (unsigned(++_tos) == _stateStack.size()) {
_stateStack.resize(_tos * 2);
_locationStack.resize(_tos * 2);
@@ -154,6 +158,7 @@ AST *Parser::parse(int startToken)
reduce(ruleno);
action = nt_action(_stateStack[_tos], lhs[ruleno] - TERMINAL_COUNT);
} else if (action == 0) {
++recoveryAttempts;
const int line = _tokens[yyloc].line + 1;
QString message = QLatin1String("Syntax error");
if (yytoken != -1) {
@@ -164,7 +169,7 @@ AST *Parser::parse(int startToken)
for (; _tos; --_tos) {
const int state = _stateStack[_tos];
static int tks[] = {
static int tks1[] = {
T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET,
T_SEMICOLON, T_COLON, T_COMMA,
T_NUMBER, T_TYPE_NAME, T_IDENTIFIER,
@@ -172,6 +177,16 @@ AST *Parser::parse(int startToken)
T_WHILE,
0
};
static int tks2[] = {
T_RIGHT_BRACE, T_RIGHT_PAREN, T_RIGHT_BRACKET,
T_SEMICOLON, T_COLON, T_COMMA,
0
};
int *tks;
if (recoveryAttempts < 2)
tks = tks1;
else
tks = tks2; // Avoid running into an endless loop for e.g.: for(int x=0; x y
for (int *tptr = tks; *tptr; ++tptr) {
const int next = t_action(state, *tptr);
@@ -194,7 +209,7 @@ AST *Parser::parse(int startToken)
yytoken = -1;
action = next;
goto again;
goto againAfterRecovery;
}
}
}

View File

@@ -1,5 +1,5 @@
#line 215 "./glsl.g"
#line 210 "./glsl.g"
/****************************************************************************
**

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,9 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -21,6 +22,8 @@
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
@@ -35,9 +38,10 @@
//
// This file was generated by qlalr - DO NOT EDIT!
#pragma once
#ifndef GLSLPARSERTABLE_P_H
#define GLSLPARSERTABLE_P_H
#include <qglobal.h>
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
@@ -228,8 +232,8 @@ public:
NON_TERMINAL_COUNT = 85,
GOTO_INDEX_OFFSET = 463,
GOTO_INFO_OFFSET = 4681,
GOTO_CHECK_OFFSET = 4681
GOTO_INFO_OFFSET = 4708,
GOTO_CHECK_OFFSET = 4708
};
static const char *const spell[];
@@ -263,3 +267,5 @@ public:
QT_END_NAMESPACE
#endif // GLSLPARSERTABLE_P_H

View File

@@ -33,6 +33,7 @@
#include "utils/environment.h"
#include <QLoggingCategory>
#include <QRegularExpression>
#include <QSettings>
namespace {
@@ -172,8 +173,9 @@ void SdkManagerOutputParser::parsePackageListing(const QString &output)
}
};
foreach (QString outputLine, output.split('\n')) {
MarkerTag marker = parseMarkers(outputLine);
QRegularExpression delimiters("[\n\r]");
foreach (QString outputLine, output.split(delimiters)) {
MarkerTag marker = parseMarkers(outputLine.trimmed());
if (marker & SectionMarkers) {
// Section marker found. Update the current section being parsed.

View File

@@ -112,17 +112,15 @@ QString BareMetalRunConfiguration::defaultDisplayName()
{
if (!m_projectFilePath.isEmpty())
//: %1 is the name of the project run via hardware debugger
return tr("%1 (via GDB server or hardware debugger)").arg(QFileInfo(m_projectFilePath).completeBaseName());
return tr("%1 (via GDB server or hardware debugger)").arg(QFileInfo(m_projectFilePath).fileName());
//: Bare Metal run configuration default run name
return tr("Run on GDB server or hardware debugger");
}
QString BareMetalRunConfiguration::localExecutableFilePath() const
{
const QString targetName = QFileInfo(m_projectFilePath).completeBaseName();
return target()->applicationTargets()
.targetFilePath(FileName::fromString(targetName).toString()).toString();
const QString targetName = QFileInfo(m_projectFilePath).fileName();
return target()->applicationTargets().targetFilePath(targetName).toString();
}
QString BareMetalRunConfiguration::arguments() const
@@ -149,7 +147,7 @@ QString BareMetalRunConfiguration::buildSystemTarget() const
{
const BuildTargetInfoList targets = target()->applicationTargets();
const Utils::FileName projectFilePath = Utils::FileName::fromString(QFileInfo(m_projectFilePath).path());
const QString targetName = QFileInfo(m_projectFilePath).completeBaseName();
const QString targetName = QFileInfo(m_projectFilePath).fileName();
auto bst = std::find_if(targets.list.constBegin(), targets.list.constEnd(),
[&projectFilePath,&targetName](const BuildTargetInfo &bti) { return bti.projectFilePath == projectFilePath && bti.targetName == targetName; });
return (bst == targets.list.constEnd()) ? QString() : bst->targetName;

View File

@@ -60,7 +60,7 @@ bool BareMetalRunConfigurationFactory::canCreate(Target *parent, Core::Id id) co
{
if (!canHandle(parent))
return false;
const QString targetName = QFileInfo(pathFromId(id)).completeBaseName();
const QString targetName = QFileInfo(pathFromId(id)).fileName();
return id == BareMetalCustomRunConfiguration::runConfigId()
|| !parent->applicationTargets().targetFilePath(targetName).isEmpty();
}
@@ -100,7 +100,7 @@ QString BareMetalRunConfigurationFactory::displayNameForId(Core::Id id) const
if (id == BareMetalCustomRunConfiguration::runConfigId())
return BareMetalCustomRunConfiguration::runConfigDefaultDisplayName();
return tr("%1 (on GDB server or hardware debugger)")
.arg(QFileInfo(pathFromId(id)).completeBaseName());
.arg(QFileInfo(pathFromId(id)).fileName());
}
RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, Core::Id id)

View File

@@ -254,6 +254,10 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
auto archs = architectures(mainTc);
if (!archs.isEmpty())
data.insert(QLatin1String(QBS_ARCHITECTURES), archs);
if (mainTc->targetAbi() !=
ProjectExplorer::Abi::abiFromTargetTriplet(mainTc->originalTargetTriple())) {
data.insert(QLatin1String(QBS_ARCHITECTURE), architecture(mainTc->targetAbi()));
}
data.insert(QLatin1String(QBS_TARGETOS), targetOSList(targetAbi, k));
QStringList toolchain = toolchainList(mainTc);

View File

@@ -78,6 +78,7 @@ const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.
const char QBS_TARGETOS[] = "qbs.targetOS";
const char QBS_SYSROOT[] = "qbs.sysroot";
const char QBS_ARCHITECTURES[] = "qbs.architectures";
const char QBS_ARCHITECTURE[] = "qbs.architecture";
const char QBS_TOOLCHAIN[] = "qbs.toolchain";
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";

View File

@@ -36,77 +36,55 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
#include <qmldebug/qmloutputparser.h>
#include <ssh/sshconnection.h>
using namespace ProjectExplorer;
using namespace Utils;
namespace Qnx {
namespace Internal {
class QnxAnalyzeeRunner : public SimpleTargetRunner
QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
: SimpleTargetRunner(runControl)
{
public:
QnxAnalyzeeRunner(RunControl *runControl, PortsGatherer *portsGatherer)
: SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer)
{
setDisplayName("QnxAnalyzeeRunner");
setDisplayName("QnxQmlProfilerSupport");
appendMessage(tr("Preparing remote side..."), Utils::LogMessageFormat);
m_portsGatherer = new PortsGatherer(runControl);
addStartDependency(m_portsGatherer);
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
addStartDependency(slog2InfoRunner);
m_profiler = runControl->createWorker(runControl->runMode());
m_profiler->addStartDependency(this);
addStopDependency(m_profiler);
}
private:
void start() override
void QnxQmlProfilerSupport::start()
{
Utils::Port port = m_portsGatherer->findPort();
Port qmlPort = m_portsGatherer->findPort();
QUrl serverUrl;
serverUrl.setHost(device()->sshParameters().host);
serverUrl.setPort(qmlPort.number());
serverUrl.setScheme("tcp");
m_profiler->recordData("QmlServerUrl", serverUrl);
QString args = QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, qmlPort);
auto r = runnable().as<StandardRunnable>();
if (!r.commandLineArguments.isEmpty())
r.commandLineArguments += ' ';
r.commandLineArguments +=
QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, port);
r.commandLineArguments.append(' ');
r.commandLineArguments += args;
setRunnable(r);
SimpleTargetRunner::start();
}
PortsGatherer *m_portsGatherer;
};
// QnxDebugSupport
QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
: RunWorker(runControl)
{
runControl->createWorker(runControl->runMode());
setDisplayName("QnxAnalyzeSupport");
appendMessage(tr("Preparing remote side..."), Utils::LogMessageFormat);
auto portsGatherer = new PortsGatherer(runControl);
auto debuggeeRunner = new QnxAnalyzeeRunner(runControl, portsGatherer);
debuggeeRunner->addStartDependency(portsGatherer);
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
slog2InfoRunner->addStartDependency(debuggeeRunner);
addStartDependency(slog2InfoRunner);
// QmlDebug::QmlOutputParser m_outputParser;
// FIXME: m_outputParser needs to be fed with application output
// connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
// this, &QnxAnalyzeSupport::remoteIsRunning);
// m_outputParser.processOutput(msg);
}
void QnxQmlProfilerSupport::start()
{
// runControl()->notifyRemoteSetupDone(m_qmlPort);
reportStarted();
}
} // namespace Internal
} // namespace Qnx

View File

@@ -25,12 +25,13 @@
#pragma once
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/runconfiguration.h>
namespace Qnx {
namespace Internal {
class QnxQmlProfilerSupport : public ProjectExplorer::RunWorker
class QnxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner
{
Q_OBJECT
@@ -39,6 +40,9 @@ public:
private:
void start() override;
ProjectExplorer::PortsGatherer *m_portsGatherer;
ProjectExplorer::RunWorker *m_profiler;
};
} // namespace Internal

View File

@@ -161,6 +161,8 @@ void QnxDebugSupport::start()
setRemoteChannel(m_portsGatherer->gdbServerChannel());
setQmlServer(m_portsGatherer->qmlServer());
setSolibSearchPath(searchPaths(k));
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k)))
setSysRoot(qtVersion->qnxTarget());
setSymbolFile(runConfig->localExecutableFilePath());
DebuggerRunTool::start();
@@ -296,6 +298,8 @@ void QnxAttachDebugSupport::showProcessesDialog()
// setRunControlName(tr("Remote: \"%1\" - Process %2").arg(remoteChannel).arg(m_process.pid));
debugger->setRunControlName(tr("Remote QNX process %1").arg(pid));
debugger->setSolibSearchPath(searchPaths(kit));
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(kit)))
debugger->setSysRoot(qtVersion->qnxTarget());
debugger->setUseContinueInsteadOfRun(true);
ProjectExplorerPlugin::startRunControl(runControl);

View File

@@ -1274,6 +1274,11 @@ void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemove
// lines were inserted or removed from outside, keep viewport on same part of text
if (q->firstVisibleBlock().blockNumber() > posBlock.blockNumber())
q->verticalScrollBar()->setValue(q->verticalScrollBar()->value() + newBlockCount - m_blockCount);
if (m_inBlockSelectionMode) {
disableBlockSelection(CursorUpdateClearSelection);
q->viewport()->update();
}
}
m_blockCount = newBlockCount;
m_scrollBarUpdateTimer.start(500);

View File

@@ -37,6 +37,8 @@
#endif // Q_CC_MSVC
#endif // Q_OS_WIN
#include <utils/asconst.h>
#include <QtTest>
#include <math.h>
@@ -58,7 +60,7 @@ static bool generateEnvironmentSettings(Utils::Environment &env,
// Note, can't just use a QTemporaryFile all the way through as it remains open
// internally so it can't be streamed to later.
QString tempOutFile;
QTemporaryFile* pVarsTempFile = new QTemporaryFile(QDir::tempPath() + QLatin1String("/XXXXXX.txt"));
QTemporaryFile* pVarsTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX.txt");
pVarsTempFile->setAutoRemove(false);
pVarsTempFile->open();
pVarsTempFile->close();
@@ -66,7 +68,7 @@ static bool generateEnvironmentSettings(Utils::Environment &env,
delete pVarsTempFile;
// Create a batch file to create and save the env settings
Utils::TempFileSaver saver(QDir::tempPath() + QLatin1String("/XXXXXX.bat"));
Utils::TempFileSaver saver(QDir::tempPath() + "/XXXXXX.bat");
QByteArray call = "call ";
call += Utils::QtcProcess::quoteArg(batchFile).toLocal8Bit();
@@ -88,13 +90,11 @@ static bool generateEnvironmentSettings(Utils::Environment &env,
// As of WinSDK 7.1, there is logic preventing the path from being set
// correctly if "ORIGINALPATH" is already set. That can cause problems
// if Creator is launched within a session set up by setenv.cmd.
env.unset(QLatin1String("ORIGINALPATH"));
env.unset("ORIGINALPATH");
run.setEnvironment(env);
const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
// Windows SDK setup scripts require command line switches for environment expansion.
QString cmdArguments = QLatin1String(" /E:ON /V:ON /c \"");
cmdArguments += QDir::toNativeSeparators(saver.fileName());
cmdArguments += QLatin1Char('"');
QString cmdArguments = " /E:ON /V:ON /c \"" + QDir::toNativeSeparators(saver.fileName()) + '"';
run.setCommand(cmdPath, cmdArguments);
run.start();
@@ -119,7 +119,7 @@ static bool generateEnvironmentSettings(Utils::Environment &env,
if (!varsFile.open(QIODevice::ReadOnly))
return false;
QRegExp regexp(QLatin1String("(\\w*)=(.*)"));
QRegExp regexp("(\\w*)=(.*)");
while (!varsFile.atEnd()) {
const QString line = QString::fromLocal8Bit(varsFile.readLine()).trimmed();
if (regexp.exactMatch(line)) {
@@ -282,7 +282,7 @@ static QString parentIName(const QString &iname)
struct Value
{
Value() : value(noValue) {}
Value(const char *str) : value(QLatin1String(str)) {}
Value(const char *str) : value(str) {}
Value(const QString &str) : value(str) {}
bool matches(const QString &actualValue0, const Context &context) const
@@ -959,11 +959,9 @@ public:
struct TempStuff
{
TempStuff(const char *tag) : buildTemp(QLatin1String("qt_tst_dumpers_")
+ QLatin1String(tag)
+ QLatin1Char('_'))
TempStuff(const char *tag) : buildTemp(QString("qt_tst_dumpers_") + tag + '_')
{
buildPath = QDir::currentPath() + QLatin1Char('/') + buildTemp.path();
buildPath = QDir::currentPath() + '/' + buildTemp.path();
buildTemp.setAutoRemove(false);
QVERIFY(!buildPath.isEmpty());
}
@@ -1030,7 +1028,7 @@ void tst_Dumpers::initTestCase()
if (base.startsWith("lldb"))
m_debuggerEngine = LldbEngine;
m_qmakeBinary = QString::fromLocal8Bit(qgetenv("QTC_QMAKE_PATH_FOR_TEST"));
m_qmakeBinary = QDir::fromNativeSeparators(QString::fromLocal8Bit(qgetenv("QTC_QMAKE_PATH_FOR_TEST")));
if (m_qmakeBinary.isEmpty())
m_qmakeBinary = "qmake";
qDebug() << "QMake : " << m_qmakeBinary;
@@ -1043,7 +1041,7 @@ void tst_Dumpers::initTestCase()
if (m_debuggerEngine == GdbEngine) {
QProcess debugger;
debugger.start(m_debuggerBinary + " -i mi -quiet -nx");
debugger.start(m_debuggerBinary, {"-i", "mi", "-quiet", "-nx"});
bool ok = debugger.waitForStarted();
debugger.write("set confirm off\npython print 43\nshow version\nquit\n");
ok = debugger.waitForFinished();
@@ -1065,18 +1063,19 @@ void tst_Dumpers::initTestCase()
version = version.mid(pos1, pos2 - pos1);
extractGdbVersion(version, &m_debuggerVersion,
&m_gdbBuildVersion, &m_isMacGdb, &m_isQnxGdb);
m_env = QProcessEnvironment::systemEnvironment();
m_makeBinary = QString::fromLocal8Bit(qgetenv("QTC_MAKE_PATH_FOR_TEST"));
m_makeBinary = QDir::fromNativeSeparators(QString::fromLocal8Bit(qgetenv("QTC_MAKE_PATH_FOR_TEST")));
#ifdef Q_OS_WIN
Utils::Environment env = Utils::Environment::systemEnvironment();
if (m_makeBinary.isEmpty())
m_makeBinary = "mingw32-make";
if (m_makeBinary != "mingw32-make")
env.prependOrSetPath(QDir::toNativeSeparators(QFileInfo(m_makeBinary).absolutePath()));
// if qmake is not in PATH make sure the correct libs for inferior are prepended to PATH
if (m_qmakeBinary != "qmake") {
Utils::Environment env = Utils::Environment::systemEnvironment();
if (m_qmakeBinary != "qmake")
env.prependOrSetPath(QDir::toNativeSeparators(QFileInfo(m_qmakeBinary).absolutePath()));
m_env = env.toProcessEnvironment();
}
#else
m_env = QProcessEnvironment::systemEnvironment();
if (m_makeBinary.isEmpty())
m_makeBinary = "make";
#endif
@@ -1093,14 +1092,14 @@ void tst_Dumpers::initTestCase()
QByteArray cdbextPath = qgetenv("QTC_CDBEXT_PATH");
if (cdbextPath.isEmpty())
cdbextPath = CDBEXT_PATH "\\qtcreatorcdbext64";
QVERIFY(QFile::exists(QString::fromLatin1(cdbextPath + QByteArray("\\qtcreatorcdbext.dll"))));
env.set(QLatin1String("_NT_DEBUGGER_EXTENSION_PATH"), QString::fromLatin1(cdbextPath));
QVERIFY(QFile::exists(cdbextPath + "\\qtcreatorcdbext.dll"));
env.set("_NT_DEBUGGER_EXTENSION_PATH", cdbextPath);
env.prependOrSetPath(QDir::toNativeSeparators(QFileInfo(m_qmakeBinary).absolutePath()));
m_makeBinary = env.searchInPath(QLatin1String("nmake.exe")).toString();
m_makeBinary = env.searchInPath("nmake.exe").toString();
m_env = env.toProcessEnvironment();
QProcess cl;
cl.start(env.searchInPath(QLatin1String("cl.exe")).toString(), QStringList());
cl.start(env.searchInPath("cl.exe").toString(), QStringList());
QVERIFY(cl.waitForFinished());
QString output = cl.readAllStandardError();
int pos = output.indexOf('\n');
@@ -1115,8 +1114,7 @@ void tst_Dumpers::initTestCase()
} else if (m_debuggerEngine == LldbEngine) {
qDebug() << "Dumper dir : " << DUMPERDIR;
QProcess debugger;
QString cmd = m_debuggerBinary + " -v";
debugger.start(cmd);
debugger.start(m_debuggerBinary, {"-v"});
bool ok = debugger.waitForFinished(2000);
QVERIFY(ok);
QByteArray output = debugger.readAllStandardOutput();
@@ -1155,7 +1153,7 @@ void tst_Dumpers::init()
void tst_Dumpers::cleanup()
{
if (!t->buildTemp.autoRemove()) {
QFile logger(t->buildPath + QLatin1String("/input.txt"));
QFile logger(t->buildPath + "/input.txt");
logger.open(QIODevice::ReadWrite);
logger.write(t->input.toUtf8());
}
@@ -1187,22 +1185,20 @@ void tst_Dumpers::dumper()
+ QByteArray::number(data.neededLldbVersion.max));
}
QString cmd;
QByteArray output;
QByteArray error;
if (data.neededQtVersion.isRestricted) {
QProcess qmake;
qmake.setWorkingDirectory(t->buildPath);
cmd = m_qmakeBinary;
qmake.start(cmd, QStringList(QLatin1String("--version")));
qmake.start(m_qmakeBinary, {"--version"});
QVERIFY(qmake.waitForFinished());
output = qmake.readAllStandardOutput();
error = qmake.readAllStandardError();
int pos0 = output.indexOf("Qt version");
if (pos0 == -1) {
qDebug() << "Output: " << output;
qDebug() << "Error: " << error;
qDebug().noquote() << "Output: " << output;
qDebug().noquote() << "Error: " << error;
QVERIFY(false);
}
pos0 += 11;
@@ -1225,8 +1221,7 @@ void tst_Dumpers::dumper()
if (data.neededGccVersion.isRestricted) {
QProcess gcc;
gcc.setWorkingDirectory(t->buildPath);
cmd = QLatin1String("gcc");
gcc.start(cmd, QStringList(QLatin1String("--version")));
gcc.start("gcc", {"--version"});
QVERIFY(gcc.waitForFinished());
output = gcc.readAllStandardOutput();
error = gcc.readAllStandardError();
@@ -1304,12 +1299,14 @@ void tst_Dumpers::dumper()
}
proFile.close();
QFile source(t->buildPath + QLatin1Char('/') + data.mainFile);
QFile source(t->buildPath + '/' + data.mainFile);
QVERIFY(source.open(QIODevice::ReadWrite));
QString fullCode = QString() +
"\n\n#if defined(_MSC_VER)" + (data.useQt ?
"\n\n#ifdef _WIN32" + (data.useQt ?
"\n#include <qt_windows.h>" :
"\n#define NOMINMAX\n#include <Windows.h>") +
"\n#define NOMINMAX\n#include <windows.h>") +
"\n#endif"
"\n#if defined(_MSC_VER)"
"\nvoid qtcDebugBreakFunction() { return; }"
"\n#define BREAK qtcDebugBreakFunction();"
"\n\nvoid unused(const void *first,...) { (void) first; }"
@@ -1389,14 +1386,13 @@ void tst_Dumpers::dumper()
QProcess qmake;
qmake.setWorkingDirectory(t->buildPath);
cmd = m_qmakeBinary;
//qDebug() << "Starting qmake: " << cmd;
//qDebug() << "Starting qmake: " << m_qmakeBinary;
QStringList options;
#ifdef Q_OS_MAC
if (m_qtVersion && m_qtVersion < 0x050000)
options << "-spec" << "unsupported/macx-clang";
#endif
qmake.start(cmd, options);
qmake.start(m_qmakeBinary, options);
QVERIFY(qmake.waitForFinished());
output = qmake.readAllStandardOutput();
error = qmake.readAllStandardError();
@@ -1423,6 +1419,7 @@ void tst_Dumpers::dumper()
qDebug().noquote() << fullCode;
qDebug() << "\n------------------ CODE --------------------";
qDebug().noquote() << "Project file: " << proFile.fileName();
QCOMPARE(make.exitCode(), 0);
}
if (data.neededDwarfVersion.isRestricted) {
@@ -1451,7 +1448,7 @@ void tst_Dumpers::dumper()
QSet<QString> expandedINames;
expandedINames.insert("local");
foreach (const Check &check, data.checks) {
for (const Check &check : Utils::asConst(data.checks)) {
QString parent = check.iname;
while (true) {
parent = parentIName(parent);
@@ -1463,7 +1460,7 @@ void tst_Dumpers::dumper()
QString expanded;
QString expandedq;
foreach (const QString &iname, expandedINames) {
for (const QString &iname : Utils::asConst(expandedINames)) {
if (!expanded.isEmpty()) {
expanded.append(',');
expandedq.append(',');
@@ -1512,13 +1509,13 @@ void tst_Dumpers::dumper()
cmds += "quit\n";
} else if (m_debuggerEngine == CdbEngine) {
args << QLatin1String("-aqtcreatorcdbext.dll")
<< QLatin1String("-G")
<< QLatin1String("-xn")
<< QLatin1String("0x4000001f")
<< QLatin1String("-c")
<< QLatin1String("bm doit!qtcDebugBreakFunction;g")
<< QLatin1String("debug\\doit.exe");
args << "-aqtcreatorcdbext.dll"
<< "-G"
<< "-xn"
<< "0x4000001f"
<< "-c"
<< "bm doit!qtcDebugBreakFunction;g"
<< "debug\\doit.exe";
cmds += "!qtcreatorcdbext.script sys.path.insert(1, '" + dumperDir + "')\n"
"!qtcreatorcdbext.script from cdbbridge import *\n"
"!qtcreatorcdbext.script theDumper = Dumper()\n"
@@ -1532,7 +1529,7 @@ void tst_Dumpers::dumper()
"'expanded':[" + expandedq + "]})\n"
"q\n";
} else if (m_debuggerEngine == LldbEngine) {
QFile fullLldb(t->buildPath + QLatin1String("/lldbcommand.txt"));
QFile fullLldb(t->buildPath + "/lldbcommand.txt");
fullLldb.setPermissions(QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner|QFile::ReadGroup|QFile::ReadOther);
fullLldb.open(QIODevice::WriteOnly);
fullLldb.write((exe + ' ' + args.join(' ') + '\n').toUtf8());
@@ -1574,7 +1571,7 @@ void tst_Dumpers::dumper()
qDebug() << error;
if (keepTemp()) {
QFile logger(t->buildPath + QLatin1String("/output.txt"));
QFile logger(t->buildPath + "/output.txt");
logger.open(QIODevice::ReadWrite);
logger.write("=== STDOUT ===\n");
logger.write(output);
@@ -1641,7 +1638,7 @@ void tst_Dumpers::dumper()
WatchItem local;
local.iname = "local";
foreach (const GdbMi &child, actual.children()) {
for (const GdbMi &child : Utils::asConst(actual.children())) {
const QString iname = child["iname"].data();
if (iname == "local.qtversion")
context.qtVersion = child["value"].toInt();
@@ -1719,7 +1716,7 @@ void tst_Dumpers::dumper()
if (!data.checks.isEmpty()) {
qDebug() << "SOME TESTS NOT EXECUTED: ";
foreach (const Check &check, data.checks) {
for (const Check &check : Utils::asConst(data.checks)) {
if (check.optionallyPresent) {
qDebug() << " OPTIONAL TEST NOT FOUND FOR INAME: " << check.iname << " IGNORED.";
} else {
@@ -3408,7 +3405,7 @@ void tst_Dumpers::dumper_data()
expected1.append(QChar(1));
expected1.append("BBB\"");
QChar oUmlaut = QLatin1Char(char(0xf6));
QChar oUmlaut = 0xf6;
QTest::newRow("QString")
<< Data("#include <QByteArray>\n"