Merge remote-tracking branch 'origin/4.5'

Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
This commit is contained in:
Oswald Buddenhagen
2017-12-21 13:20:24 +01:00
22 changed files with 84 additions and 55 deletions

View File

@@ -65,7 +65,7 @@
\list
\li \c {Qt Creator.app/Contents/MacOS/Qt Creator -help}
\li \c {Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help}
\endlist

View File

@@ -225,13 +225,7 @@ class Dumper(DumperBase):
return None
def parseAndEvaluate(self, exp):
val = cdbext.parseAndEvaluate(exp)
if val is None:
return None
value = self.Value(self)
value.type = self.lookupType('void *')
value.ldata = val.to_bytes(8, sys.byteorder)
return value
return self.fromNativeValue(cdbext.parseAndEvaluate(exp))
def isWindowsTarget(self):
return True
@@ -316,12 +310,12 @@ class Dumper(DumperBase):
if namespaceIndex > 0:
namespace = name[:namespaceIndex + 2]
self.qtNamespace = lambda: namespace
self.qtCustomEventFunc = cdbext.parseAndEvaluate('%s!%sQObject::customEvent'
% (self.qtCoreModuleName(), namespace))
self.qtCustomEventFunc = self.parseAndEvaluate('%s!%sQObject::customEvent'
% (self.qtCoreModuleName(), namespace)).address()
return namespace
def qtVersion(self):
qtVersion = self.findValueByExpression('((void**)&%s)[2]' % self.qtHookDataSymbolName())
qtVersion = self.parseAndEvaluate('((void**)&%s)[2]' % self.qtHookDataSymbolName()).integer()
if qtVersion is None and self.qtCoreModuleName() is not None:
try:
versionValue = cdbext.call(self.qtCoreModuleName() + '!qVersion()')

View File

@@ -710,7 +710,7 @@ class Dumper(DumperBase):
self.output += ',partial="%d"' % isPartial
self.output += ',counts=%s' % self.counts
self.output += ',timimgs=%s' % self.timings
self.output += ',timings=%s' % self.timings
self.reportResult(self.output)
def parseAndEvaluate(self, exp):

View File

@@ -1151,7 +1151,7 @@ class Dumper(DumperBase):
# values = [frame.FindVariable(partialVariable)]
#else:
if True:
values = list(frame.GetVariables(True, True, False, False))
values = list(frame.GetVariables(True, True, False, True))
values.reverse() # To get shadowed vars numbered backwards.
variables = []

View File

@@ -106,12 +106,13 @@ static PyObject *cdbext_parseAndEvaluate(PyObject *, PyObject *args) // -> Value
ULONG oldExpressionSyntax;
control->GetExpressionSyntax(&oldExpressionSyntax);
control->SetExpressionSyntax(DEBUG_EXPR_CPLUSPLUS);
DEBUG_VALUE value;
HRESULT hr = control->Evaluate(expr, DEBUG_VALUE_INT64, &value, NULL);
IDebugSymbolGroup2 *symbolGroup = CurrentSymbolGroup::get();
ULONG index = DEBUG_ANY_ID;
HRESULT hr = symbolGroup->AddSymbol(expr, &index);
control->SetExpressionSyntax(oldExpressionSyntax);
if (FAILED(hr))
Py_RETURN_NONE;
return Py_BuildValue("K", value.I64);
return createPythonObject(PyValue(index, symbolGroup));
}
static PyObject *cdbext_resolveSymbol(PyObject *, PyObject *args) // -> Value

View File

@@ -63,7 +63,7 @@ Item {
id: row
property int firstBlock: timeDisplay.offsetX / timeDisplay.pixelsPerBlock
property int offset: repeater.model - (firstBlock % repeater.model);
property int offset: repeater.model > 0 ? repeater.model - (firstBlock % repeater.model) : 0;
Repeater {
id: repeater

View File

@@ -195,6 +195,15 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
futureInterface.setProgressValue(0);
for (const TestConfiguration *testConfiguration : selectedTests) {
QString commandFilePath = testConfiguration->executableFilePath();
if (commandFilePath.isEmpty()) {
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
TestRunner::tr("Executable path is empty. (%1)")
.arg(testConfiguration->displayName()))));
continue;
}
testProcess.setProgram(commandFilePath);
QScopedPointer<TestOutputReader> outputReader;
outputReader.reset(testConfiguration->outputReader(futureInterface, &testProcess));
QTC_ASSERT(outputReader, continue);
@@ -206,15 +215,6 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
if (!testConfiguration->project())
continue;
QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment();
QString commandFilePath = testConfiguration->executableFilePath();
if (commandFilePath.isEmpty()) {
futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
TestRunner::tr("Executable path is empty. (%1)")
.arg(testConfiguration->displayName()))));
continue;
}
QStringList omitted;
testProcess.setArguments(testConfiguration->argumentsForTestRunner(&omitted));
if (!omitted.isEmpty()) {
@@ -223,10 +223,10 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface,
details.arg(testConfiguration->displayName()))));
}
testProcess.setWorkingDirectory(testConfiguration->workingDirectory());
QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment();
if (Utils::HostOsInfo::isWindowsHost())
environment.insert("QT_LOGGING_TO_CONSOLE", "1");
testProcess.setProcessEnvironment(environment);
testProcess.setProgram(commandFilePath);
testProcess.start();
bool ok = testProcess.waitForStarted();

View File

@@ -566,6 +566,7 @@ void CdbEngine::handleInitialSessionIdle()
[this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }});
}
runCommand({".symopt+0x8000"}); // disable searching public symbol table - improving the symbol lookup speed
runCommand({"sxn 0x4000001f", NoFlags}); // Do not break on WowX86 exceptions.
runCommand({"sxn ibp", NoFlags}); // Do not break on initial breakpoints.
runCommand({".asm source_line", NoFlags}); // Source line in assembly

View File

@@ -633,7 +633,6 @@ void DebuggerEngine::notifyEngineSetupFailed()
setState(EngineSetupFailed);
if (isMasterEngine() && runTool()) {
showMessage(tr("Debugging has failed"), NormalMessageFormat);
d->m_runTool.clear();
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
d->m_progress.reportFinished();

View File

@@ -146,16 +146,20 @@ QDebug operator<<(QDebug d, const VisualStudioInstallation &i)
return d;
}
// Detect build tools introduced with MSVC2017
static Utils::optional<VisualStudioInstallation> detectCppBuildTools2017()
static QString windowsProgramFilesDir()
{
#ifdef Q_OS_WIN64
const char programFilesC[] = "ProgramFiles(x86)";
#else
const char programFilesC[] = "ProgramFiles";
#endif
return QDir::fromNativeSeparators(QFile::decodeName(qgetenv(programFilesC)));
}
const QString installPath = QDir::fromNativeSeparators(QFile::decodeName(qgetenv(programFilesC)))
// Detect build tools introduced with MSVC2017
static Utils::optional<VisualStudioInstallation> detectCppBuildTools2017()
{
const QString installPath = windowsProgramFilesDir()
+ "/Microsoft Visual Studio/2017/BuildTools";
const QString vcVarsPath = installPath + "/VC/Auxiliary/Build";
const QString vcVarsAllPath = vcVarsPath + "/vcvarsall.bat";
@@ -887,13 +891,8 @@ static void detectCppBuildTools2015(QList<ToolChain *> *list)
{" (x64_arm)", "amd64_arm", Abi::ArmArchitecture, Abi::PEFormat, 64}
};
#ifdef Q_OS_WIN64
const char programFilesC[] = "ProgramFiles(x86)";
#else
const char programFilesC[] = "ProgramFiles";
#endif
const QString name = QStringLiteral("Microsoft Visual C++ Build Tools");
const QString vcVarsBat = QFile::decodeName(qgetenv(programFilesC))
const QString vcVarsBat = windowsProgramFilesDir()
+ QLatin1Char('/') + name + QStringLiteral("/vcbuildtools.bat");
if (!QFileInfo(vcVarsBat).isFile())
return;

View File

@@ -296,8 +296,10 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
if (toolchain.contains(QLatin1String("msvc"))) {
data.insert(QLatin1String(CPP_COMPILERNAME), mainCompilerName);
} else {
if (!mainCompilerName.isEmpty())
data.insert(QLatin1String(CPP_COMPILERNAME), mainCompilerName);
if (!cCompilerName.isEmpty())
data.insert(QLatin1String(CPP_COMPILERNAME), cCompilerName);
data.insert(QLatin1String(CPP_CCOMPILERNAME), cCompilerName);
if (!cxxCompilerName.isEmpty())
data.insert(QLatin1String(CPP_CXXCOMPILERNAME), cxxCompilerName);
}

View File

@@ -84,6 +84,7 @@ const char QBS_TOOLCHAIN[] = "qbs.toolchain";
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
const char CPP_COMPILERNAME[] = "cpp.compilerName";
const char CPP_CCOMPILERNAME[] = "cpp.cCompilerName";
const char CPP_CXXCOMPILERNAME[] = "cpp.cxxCompilerName";
const char CPP_PLATFORMCOMMONCOMPILERFLAGS[] = "cpp.platformCommonCompilerFlags";
const char CPP_PLATFORMLINKERFLAGS[] = "cpp.platformLinkerFlags";

View File

@@ -262,7 +262,9 @@ bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
if (!extraId.isEmpty())
m_proFilePath = FileName::fromString(extraId);
return RunConfiguration::fromMap(map);
const bool res = RunConfiguration::fromMap(map);
updateTargetInformation();
return res;
}
QString DesktopQmakeRunConfiguration::executable() const

View File

@@ -53,7 +53,11 @@ QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmak
QmakePriFile *QmakePriFileNode::priFile() const
{
if (!m_project->isParsing())
return m_qmakePriFile;
// During a parsing run the qmakePriFile tree will change, so search for the PriFile and
// do not depend on the cached value.
return m_project->rootProFile()->findPriFile(filePath());
}
bool QmakePriFileNode::deploysFolder(const QString &folder) const

View File

@@ -86,7 +86,7 @@ void FormEditorItem::setup()
QRectF FormEditorItem::boundingRect() const
{
return m_boundingRect;
return m_boundingRect.adjusted(-2, -2, 2, 2);
}
QPainterPath FormEditorItem::shape() const
@@ -338,7 +338,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
if (isInStackedContainer)
showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible();
painter->setClipRegion(m_boundingRect.toRect());
painter->setClipRegion(boundingRect().toRect());
painter->setClipping(true);
if (!hideCompletely) {

View File

@@ -113,10 +113,12 @@ int QmlTimelineFrames::indexOfFrame(const ModelNode &frame) const
return modelNode().defaultNodeListProperty().indexOf(frame);
}
void QmlTimelineFrames::slideFrame(int sourceIndex, int targetIndex)
void QmlTimelineFrames::slideFrame(int /*sourceIndex*/, int /*targetIndex*/)
{
/*
if (targetIndex != sourceIndex)
modelNode().defaultNodeListProperty().slide(sourceIndex, targetIndex);
*/
}
void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame)

View File

@@ -126,7 +126,7 @@ void DocumentWarningWidget::refreshContent()
}
QString messageString;
DocumentMessage message = m_messages.at(m_currentMessage);
DocumentMessage message = m_messages.value(m_currentMessage);
if (message.type() == DocumentMessage::ParseError) {
messageString += errorToString(message);
m_navigateLabel->setText(generateNavigateLinks());

View File

@@ -56,6 +56,7 @@ public:
bool updateFeatures(ProfileFeature feature);
int resolveType(const QmlTypedEvent &type);
int resolveStackTop();
void forwardEvents(const QmlEvent &last);
void processCurrentEvent();
QmlProfilerTraceClient *q;
@@ -74,6 +75,7 @@ public:
QHash<qint64, int> serverTypeIds;
QStack<QmlTypedEvent> rangesInProgress;
QQueue<QmlEvent> pendingMessages;
QQueue<QmlEvent> pendingDebugMessages;
};
int QmlProfilerTraceClientPrivate::resolveType(const QmlTypedEvent &event)
@@ -117,12 +119,21 @@ int QmlProfilerTraceClientPrivate::resolveStackTop()
typedEvent.event.setTypeIndex(typeIndex);
while (!pendingMessages.isEmpty()
&& pendingMessages.head().timestamp() < typedEvent.event.timestamp()) {
modelManager->addEvent(pendingMessages.dequeue());
forwardEvents(pendingMessages.dequeue());
}
modelManager->addEvent(typedEvent.event);
forwardEvents(typedEvent.event);
return typeIndex;
}
void QmlProfilerTraceClientPrivate::forwardEvents(const QmlEvent &last)
{
while (!pendingDebugMessages.isEmpty()
&& pendingDebugMessages.front().timestamp() <= last.timestamp()) {
modelManager->addEvent(pendingDebugMessages.dequeue());
}
modelManager->addEvent(last);
}
void QmlProfilerTraceClientPrivate::processCurrentEvent()
{
// RangeData and RangeLocation always apply to the range on the top of the stack. Furthermore,
@@ -142,8 +153,8 @@ void QmlProfilerTraceClientPrivate::processCurrentEvent()
break;
currentEvent.event.setTypeIndex(typeIndex);
while (!pendingMessages.isEmpty())
modelManager->addEvent(pendingMessages.dequeue());
modelManager->addEvent(currentEvent.event);
forwardEvents(pendingMessages.dequeue());
forwardEvents(currentEvent.event);
rangesInProgress.pop();
break;
}
@@ -155,11 +166,15 @@ void QmlProfilerTraceClientPrivate::processCurrentEvent()
if (!rangesInProgress.isEmpty())
rangesInProgress.top().type.setLocation(currentEvent.type.location());
break;
case DebugMessage:
currentEvent.event.setTypeIndex(resolveType(currentEvent));
pendingDebugMessages.enqueue(currentEvent.event);
break;
default: {
int typeIndex = resolveType(currentEvent);
currentEvent.event.setTypeIndex(typeIndex);
if (rangesInProgress.isEmpty())
modelManager->addEvent(currentEvent.event);
forwardEvents(currentEvent.event);
else
pendingMessages.enqueue(currentEvent.event);
break;
@@ -204,6 +219,7 @@ void QmlProfilerTraceClient::clear()
d->eventTypeIds.clear();
d->rangesInProgress.clear();
d->pendingMessages.clear();
d->pendingDebugMessages.clear();
if (d->recordedFeatures != 0) {
d->recordedFeatures = 0;
emit recordedFeaturesChanged(0);
@@ -248,7 +264,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features)
[this](QtMsgType type, const QString &text,
const QmlDebug::QDebugContextInfo &context)
{
d->updateFeatures(ProfileDebugMessages);
QTC_ASSERT(d->updateFeatures(ProfileDebugMessages), return);
d->currentEvent.event.setTimestamp(context.timestamp > 0 ? context.timestamp : 0);
d->currentEvent.event.setTypeIndex(-1);
d->currentEvent.event.setString(text);
@@ -299,6 +315,10 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
d->currentEvent.event.setTimestamp(d->maximumTime);
d->processCurrentEvent();
}
QTC_CHECK(d->pendingMessages.isEmpty());
while (!d->pendingDebugMessages.isEmpty())
d->modelManager->addEvent(d->pendingDebugMessages.dequeue());
emit complete(d->maximumTime);
} else if (d->currentEvent.type.message() == Event
&& d->currentEvent.type.detailType() == StartTrace) {

View File

@@ -1517,7 +1517,8 @@ void tst_Dumpers::dumper()
<< "-c"
<< "bm doit!qtcDebugBreakFunction;g"
<< "debug\\doit.exe";
cmds += "!qtcreatorcdbext.script sys.path.insert(1, '" + dumperDir + "')\n"
cmds += ".symopt+0x8000\n"
"!qtcreatorcdbext.script sys.path.insert(1, '" + dumperDir + "')\n"
"!qtcreatorcdbext.script from cdbbridge import *\n"
"!qtcreatorcdbext.script theDumper = Dumper()\n"
"!qtcreatorcdbext.script theDumper.setupDumpers()\n"

View File

@@ -120,8 +120,7 @@ void tst_ImportCheck::test_data()
QTest::addColumn<QStringList>("expectedFiles");
QTest::newRow("base") << QStringList(QString(TESTSRCDIR "/base"))
<< QStringList({"QML 1.0", "QtQml 2.2", "QtQml 2.1", "QtQuick 2.0",
"QtQml 2.0", "QtQuick 2.-1", "QtQuick 2.1",
"QtQuick 2.2", "<cpp>"})
"QtQml 2.0", "QtQuick 2.1", "QtQuick 2.2", "<cpp>"})
<< QStringList();
QTest::newRow("001_flatQmlOnly") << QStringList(QString(TESTSRCDIR "/001_flatQmlOnly"))
<< QStringList()

View File

@@ -77,6 +77,10 @@ def main():
}
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if (useClang and platform.system() in ('Windows', 'Microsoft')
and JIRA.isBugStillOpen(18607)):
test.warning("Skipping unstable tests on Windows", "See QTCREATORBUG-18607")
continue
if not startCreator(useClang):
continue
projectName = createNewNonQtProject()

View File

@@ -52,7 +52,7 @@ def main():
test.log("Setting breakpoints")
result = setBreakpointsForCurrentProject(filesAndLines)
if result:
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):12},
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10},
{os.path.join(workingDir, projectName, "main.qml"):13}]
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
progressBarWait()