diff --git a/doc/src/android/androiddev.qdoc b/doc/src/android/androiddev.qdoc index 5f01a32b82b..247009d6f01 100644 --- a/doc/src/android/androiddev.qdoc +++ b/doc/src/android/androiddev.qdoc @@ -32,15 +32,15 @@ \title Connecting Android Devices - You can connect Android devices to the development PC to build, run, debug, - and analyze applications on them from \QC. + You can connect Android devices to the development PC to run, debug, + and analyze applications built for them from \QC. If you have a tool chain for building applications for Android devices installed on the development PC, you can add it to \QC. You can then add a \l{glossary-buildandrun-kit}{kit} with the Android device type, the tool chain, and the Qt version for Android, - to build and run applications on Android devices. You can also allow \QC to - automatically configure the kit. + to build applications for and run them on Android devices. You can also + allow \QC to automatically configure the kit. The Android Debug Bridge (adb) command line tool is integrated to \QC to enable you to deploy applications to connected Android devices, to run diff --git a/doc/src/baremetal/creator-baremetal-dev.qdoc b/doc/src/baremetal/creator-baremetal-dev.qdoc index 4ee8d3b9eea..a8bf365036a 100644 --- a/doc/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/src/baremetal/creator-baremetal-dev.qdoc @@ -92,7 +92,7 @@ \li Select \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} > \uicontrol Kits > \uicontrol Add to add a - kit for building and running applications on bare metal devices: + kit for building applications and running them on bare metal devices: \image creator-baremetal-kits.png "Bare Metal Device kits" @@ -114,7 +114,7 @@ device. \li Select \uicontrol Projects > \uicontrol {Build & Run}, and then - select the kit for building and running the application on the bare + select the kit for building the application and running it on the bare metal device specified in the kit. \image creator-baremetal-kit-for-project.png "Adding a bare metal kit for a project" diff --git a/doc/src/ios/creator-ios-dev.qdoc b/doc/src/ios/creator-ios-dev.qdoc index 03b680783b4..06ff7f72a47 100644 --- a/doc/src/ios/creator-ios-dev.qdoc +++ b/doc/src/ios/creator-ios-dev.qdoc @@ -33,12 +33,12 @@ \title Connecting iOS Devices You can connect iOS devices to a Mac computer with a USB cable to - build and run applications on them from \QC. + run applications built for them from \QC. To be able to use \QC on \macos, you must install Xcode, and therefore, you already have the tool chain for building applications for iOS. \QC automatically detects the tool chain and creates the necessary - \l{glossary-buildandrun-kit}{kits} for building and running applications on + \l{glossary-buildandrun-kit}{kits} to build applications for and run them on configured iOS devices. You only need Qt libraries that are built for iOS. You can install them as @@ -85,7 +85,7 @@ device. \li Select \uicontrol Projects > \uicontrol {Build & Run} to select - the kit for building and running applications on iOS. + the kit for building applications for and running them on iOS. \image qtcreator-ios-add-kit.png "Build & Run Settings" diff --git a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc index 27c5f13b78d..5b7045703cf 100644 --- a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc +++ b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc @@ -28,7 +28,7 @@ \section1 Running on Embedded Linux Devices - To build and run the application for a device: + To build the application and run it on a device: \list 1 diff --git a/doc/src/linux-mobile/linuxdev.qdoc b/doc/src/linux-mobile/linuxdev.qdoc index d28c32f8298..cfa24114f4f 100644 --- a/doc/src/linux-mobile/linuxdev.qdoc +++ b/doc/src/linux-mobile/linuxdev.qdoc @@ -32,14 +32,14 @@ \title Connecting Embedded Linux Devices - You can connect embedded Linux devices to the development PC to build, run, - debug, and analyze applications on them from \QC. + You can connect embedded Linux devices to the development PC to run, + debug, and analyze applications built for them from \QC. If you have a tool chain for building applications for embedded Linux devices installed on the development PC, you can add it to \QC. You can then select a \l{glossary-buildandrun-kit}{kit} with \uicontrol {Embedded Linux} device type to - build and run applications on embedded Linux devices. + build applications for and run them on embedded Linux devices. To be able to run and debug applications on embedded Linux devices, you must add devices and select them in the \QC \l{glossary-buildandrun-kit}{kit}. diff --git a/doc/src/overview/creator-glossary.qdoc b/doc/src/overview/creator-glossary.qdoc index 257f526232c..3ccb302c26b 100644 --- a/doc/src/overview/creator-glossary.qdoc +++ b/doc/src/overview/creator-glossary.qdoc @@ -107,7 +107,7 @@ \li Project \target glossary-project \li Groups together a set of source files, forms, and resource files - that you can build, deploy, and run for different desktop, + that you can build for, as well as deploy and run on different desktop, embedded, and mobile device platforms, as specified by a \e {build configuration}, \e {deploy configuration}, and \e {run configuration}. diff --git a/doc/src/overview/creator-mobile-targets.qdoc b/doc/src/overview/creator-mobile-targets.qdoc index 3600f9aa1ce..a0ea95905dc 100644 --- a/doc/src/overview/creator-mobile-targets.qdoc +++ b/doc/src/overview/creator-mobile-targets.qdoc @@ -37,8 +37,8 @@ \title Connecting Mobile Devices - You can connect mobile devices to the development PC to build, run, debug, - and analyze applications on them from \QC. When you install Qt for a + You can connect mobile devices to the development PC to run, debug, + and analyze applications built for them from \QC. When you install Qt for a target platform, such as Android or QNX, the build and run settings for the development targets might be set up automatically in \QC. diff --git a/doc/src/overview/creator-overview.qdoc b/doc/src/overview/creator-overview.qdoc index 1c2bf533e7f..097c936af6f 100644 --- a/doc/src/overview/creator-overview.qdoc +++ b/doc/src/overview/creator-overview.qdoc @@ -92,9 +92,9 @@ projects as \e {generic projects} and fully control the steps and commands used to build the project. - \QC provides support for building, running, and deploying Qt - applications for desktop environment as well as embedded and - mobile devices. \l{glossary-buildandrun-kit}{Kits}, build, + \QC provides support for running and deploying Qt applications + built for the desktop environment as well as embedded and + mobile devices. \l{glossary-buildandrun-kit}{Kits}, build, run, and deployment settings allow you to quickly switch between different setups and target platforms. diff --git a/doc/src/projects/creator-projects-building-running.qdoc b/doc/src/projects/creator-projects-building-running.qdoc index 955d6d96f9e..0607b09df57 100644 --- a/doc/src/projects/creator-projects-building-running.qdoc +++ b/doc/src/projects/creator-projects-building-running.qdoc @@ -39,7 +39,7 @@ \image creator_buildingrunning.png - \QC provides support for building, running, and deploying Qt applications + \QC provides support for running and deploying Qt applications built for different target platforms, or using different compilers, debuggers, or Qt versions. \l{glossary-buildandrun-kit}{Kits} define the tools, diff --git a/doc/src/projects/creator-projects-compilers.qdoc b/doc/src/projects/creator-projects-compilers.qdoc index 15ded1f9b83..4ae231b2caa 100644 --- a/doc/src/projects/creator-projects-compilers.qdoc +++ b/doc/src/projects/creator-projects-compilers.qdoc @@ -40,8 +40,8 @@ Qt is supported on a variety of 32-bit and 64-bit platforms, and can usually be built on each platform with GCC, a vendor-supplied compiler, or a third party compiler. In \QC, a \l{glossary-buildandrun-kit}{kit} - specifies the compiler and other necessary tools for building and running an - application on a particular platform. + specifies the compiler and other necessary tools for building an application + for and running it on a particular platform. \QC automatically detects the compilers that are registered by your system or by an installer. You can add compilers to build applications by using other diff --git a/doc/src/qtquick/creator-mobile-app-tutorial.qdoc b/doc/src/qtquick/creator-mobile-app-tutorial.qdoc index fc6b130bd66..e04018d9e0b 100644 --- a/doc/src/qtquick/creator-mobile-app-tutorial.qdoc +++ b/doc/src/qtquick/creator-mobile-app-tutorial.qdoc @@ -49,7 +49,7 @@ \section1 Setting up the Development Environment - To be able to build and run the application on a mobile device, you must + To be able to build the application for and run it on a mobile device, you must set up the development environment for the device platform and configure a connection between \QC and the mobile device. diff --git a/doc/src/winrt/creator-winrt.qdoc b/doc/src/winrt/creator-winrt.qdoc index 9342466beb5..a4b0a7181c6 100644 --- a/doc/src/winrt/creator-winrt.qdoc +++ b/doc/src/winrt/creator-winrt.qdoc @@ -61,7 +61,7 @@ device. \li Select \uicontrol Projects > \uicontrol {Build & Run} to - enable a kit for building and running applications on Windows + enable a kit for building applications and running them on Windows Runtime devices (the local computer, for now), Windows Phones, or the Windows Phone emulator. diff --git a/scripts/gcc2tasks.pl b/scripts/gcc2tasks.pl index 448a231c6ac..1a6dbc546d1 100755 --- a/scripts/gcc2tasks.pl +++ b/scripts/gcc2tasks.pl @@ -41,11 +41,12 @@ while (my $line = ) { chomp($line); # --- extract file name based matching: # file.cpp:214:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - if ($line =~ /^([^:]+):(\d+):\d*:? warning: (.*)$/) { + if ($line =~ /^([^:]+):(\d+):\d*:? (warning|error): (.*)$/) { my $fileName = $1; my $lineNumber = $2; - my $text = $3; + my $type = $3 eq 'warning' ? 'warn' : 'err'; + my $text = $4; $fileName =~ s|\\|/|g; - print $fileName, "\t", $lineNumber, "\twarn\t", $text,"\n"; + print $fileName, "\t", $lineNumber, "\t", $type, "\t", $text,"\n"; } } diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 4f243823909..ec0564e6b4c 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -317,7 +317,7 @@ def qdump__QDateTime(d, value): spec = (status & 0x30) >> 4 isValid = True - d.putValue('%s/%s/%s/%s/%s' % (msecs, spec, offsetFromUtc, timeZone, status), + d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offsetFromUtc, timeZone, status, tiVersion), 'datetimeinternal') else: if d.isWindowsTarget(): @@ -344,7 +344,7 @@ def qdump__QDateTime(d, value): else: idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr] elided, tz = d.encodeByteArrayHelper(d.extractPointer(idBase), limit=100) - d.putValue('%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status), + d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status, 0), 'datetimeinternal') else: # This relies on the Qt4/Qt5 internal structure layout: diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 0a9138911e7..881c985f866 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -230,6 +230,32 @@ static bool symbolIdentical(Symbol *s1, Symbol *s2) return QByteArray(s1->fileName()) == QByteArray(s2->fileName()); } +static const Name *toName(const QList &names, Control *control) +{ + const Name *n = 0; + for (int i = names.size() - 1; i >= 0; --i) { + if (! n) + n = names.at(i); + else + n = control->qualifiedNameId(names.at(i), n); + } + + return n; +} + +static bool isInlineNamespace(ClassOrNamespace *con, const Name *name) +{ + const QList items = con->find(name); + if (!items.isEmpty()) { + if (const Symbol *declaration = items.first().declaration() ) { + if (const Namespace *ns = declaration->asNamespace()) + return ns->isInline(); + } + } + + return false; +} + const Name *LookupContext::minimalName(Symbol *symbol, ClassOrNamespace *target, Control *control) { const Name *n = 0; @@ -245,8 +271,17 @@ const Name *LookupContext::minimalName(Symbol *symbol, ClassOrNamespace *target, if (target) { const QList tresults = target->lookup(n); foreach (const LookupItem &tr, tresults) { - if (symbolIdentical(tr.declaration(), symbol)) - return n; + if (symbolIdentical(tr.declaration(), symbol)) { + // eliminate inline namespaces + QList minimal = names.mid(i); + for (int i = minimal.size() - 2; i >= 0; --i) { + const Name *candidate = toName(minimal.mid(0, i + 1), control); + if (isInlineNamespace(target, candidate)) + minimal.removeAt(i); + } + + return toName(minimal, control); + } } } } diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp index 9b18aa3922c..60e169d4bf0 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp @@ -902,6 +902,20 @@ std::string QtInfo::prependModuleAndNameSpace(const std::string &type, return rc; } +int QtInfo::qtTypeInfoVersion(const SymbolGroupValueContext &ctx) +{ + const QtInfo qtInfo = QtInfo::get(ctx); + const std::string &hookDataSymbolName = qtInfo.prependQtCoreModule("qtHookData"); + ULONG64 offset = 0; + if (FAILED(ctx.symbols->GetOffsetByName(hookDataSymbolName.c_str(), &offset))) + return 0; + ULONG64 hookVer = SymbolGroupValue::readPointerValue(ctx.dataspaces, offset); + if (hookVer < 3) + return 0; + offset += 6 * SymbolGroupValue::pointerSize(); + return static_cast(SymbolGroupValue::readPointerValue(ctx.dataspaces, offset)); +} + std::ostream &operator<<(std::ostream &os, const QtInfo &i) { os << "Qt Info: Version: " << i.version << " Modules '" @@ -2404,33 +2418,59 @@ static bool dumpQDateTime(const SymbolGroupValue &v, std::wostream &str, std::st { // QDate is 64bit starting from Qt 5 which is always aligned 64bit. if (QtInfo::get(v.context()).version == 5) { - // the dumper on the creator side expects msecs/spec/offset/tz/status + // the dumper on the creator side expects msecs/spec/offset/tz/status/type info version const char separator = '/'; - const ULONG64 msecsAddr = addressOfQPrivateMember(v, QPDM_None, 0); - if (!msecsAddr) - return false; + LONG64 msecs = 0; + int spec = 0; + int offset = 0; + std::wstring timeZoneString; + int status = 0; + int tiVersion = QtInfo::qtTypeInfoVersion(v.context()); + if (tiVersion > 10) { + const ULONG64 data = SymbolGroupValue::readUnsignedValue( + v.context().dataspaces, v.address(), 8, 0); + status = data & 0xFF; + ULONG64 timeZone = 0; + if (status & 0x01) { + msecs = data >> 8; + spec = (status & 0x30) >> 4; + } else { + ULONG64 addr = SymbolGroupValue::readPointerValue(v.context().dataspaces, v.address()); + msecs = SymbolGroupValue::readSignedValue(v.context().dataspaces, addr, 8, 0); - int addrOffset = 8 /*QSharedData + padded*/; - const LONG64 msecs = SymbolGroupValue::readSignedValue( - v.context().dataspaces, msecsAddr + addrOffset, 8, 0); + addr += 8 /*int64*/; + status = SymbolGroupValue::readIntValue(v.context().dataspaces, addr); - addrOffset += 8 /*int64*/; - const int spec = SymbolGroupValue::readIntValue( - v.context().dataspaces, msecsAddr + addrOffset); + addr += SymbolGroupValue::intSize(); + offset = SymbolGroupValue::readIntValue(v.context().dataspaces, addr); - addrOffset += SymbolGroupValue::sizeOf("Qt::TimeSpec"); - const int offset = SymbolGroupValue::readIntValue( - v.context().dataspaces, msecsAddr + addrOffset); + addr += 2 * SymbolGroupValue::intSize(); + timeZone = SymbolGroupValue::readPointerValue(v.context().dataspaces, addr); + } + timeZoneString = std::to_wstring(timeZone); + } else { + const ULONG64 msecsAddr = addressOfQPrivateMember(v, QPDM_None, 0); + if (!msecsAddr) + return false; - addrOffset += SymbolGroupValue::intSize(); - std::wostringstream timeZoneStream; - dumpQTimeZoneFromQPrivateClass(v, QPDM_None, addrOffset, timeZoneStream, 0); - const std::wstring &timeZoneString = timeZoneStream.str(); + int addrOffset = 8 /*QSharedData + padded*/; + msecs = SymbolGroupValue::readSignedValue( + v.context().dataspaces, msecsAddr + addrOffset, 8, 0); - addrOffset += SymbolGroupValue::sizeOf("QTimeZone"); - const int status = SymbolGroupValue::readIntValue( - v.context().dataspaces, msecsAddr + addrOffset); + addrOffset += 8 /*int64*/; + spec = SymbolGroupValue::readIntValue(v.context().dataspaces, msecsAddr + addrOffset); + addrOffset += SymbolGroupValue::sizeOf("Qt::TimeSpec"); + offset = SymbolGroupValue::readIntValue(v.context().dataspaces, msecsAddr + addrOffset); + + addrOffset += SymbolGroupValue::intSize(); + std::wostringstream timeZoneStream; + dumpQTimeZoneFromQPrivateClass(v, QPDM_None, addrOffset, timeZoneStream, 0); + timeZoneString = timeZoneStream.str(); + + addrOffset += SymbolGroupValue::sizeOf("QTimeZone"); + status = SymbolGroupValue::readIntValue(v.context().dataspaces, msecsAddr + addrOffset); + } enum StatusFlag { ValidDate = 0x04, ValidTime = 0x08, @@ -2440,12 +2480,12 @@ static bool dumpQDateTime(const SymbolGroupValue &v, std::wostream &str, std::st str << L"(invalid)"; return true; } - str << msecs << separator << spec << separator << offset << separator << timeZoneString << separator - << status; + << status << separator + << tiVersion; if (encoding) *encoding = "datetimeinternal"; diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.h b/src/libs/qtcreatorcdbext/symbolgroupvalue.h index 2ab829acb9f..61c5a67523e 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.h +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.h @@ -230,6 +230,8 @@ struct QtInfo const std::string &module, const std::string &nameSpace); + static int qtTypeInfoVersion(const SymbolGroupValueContext &ctx); + std::string moduleName(Module m) const; int version = 0; diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 0b4ac2d1eb6..98efc64ffe1 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -64,6 +64,7 @@ const QLatin1String UninstallPreviousPackageKey("UninstallPreviousPackage"); const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"); const QLatin1String InstallFailedUpdateIncompatible("INSTALL_FAILED_UPDATE_INCOMPATIBLE"); const QLatin1String InstallFailedPermissionModelDowngrade("INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE"); +const QLatin1String InstallFailedVersionDowngrade("INSTALL_FAILED_VERSION_DOWNGRADE"); const Core::Id AndroidDeployQtStep::Id("Qt4ProjectManager.AndroidDeployQtStep"); ////////////////// @@ -389,6 +390,9 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode) case UpdateIncompatible: uninstallMsg += InstallFailedUpdateIncompatible+"\n"; break; + case VersionDowngrade: + uninstallMsg += InstallFailedVersionDowngrade+"\n"; + break; default: break; } @@ -517,6 +521,8 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QStr errorCode |= UpdateIncompatible; if (deployOutputLine.contains(InstallFailedPermissionModelDowngrade)) errorCode |= PermissionModelDowngrade; + if (deployOutputLine.contains(InstallFailedVersionDowngrade)) + errorCode |= VersionDowngrade; return errorCode; } diff --git a/src/plugins/android/androiddeployqtstep.h b/src/plugins/android/androiddeployqtstep.h index 2fb85d82233..734fc805457 100644 --- a/src/plugins/android/androiddeployqtstep.h +++ b/src/plugins/android/androiddeployqtstep.h @@ -66,7 +66,8 @@ class AndroidDeployQtStep : public ProjectExplorer::BuildStep InconsistentCertificates = 0x0001, UpdateIncompatible = 0x0002, PermissionModelDowngrade = 0x0004, - Failure = 0x0008 + VersionDowngrade = 0x0008, + Failure = 0x0010 }; public: diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 3bbf232311e..f0990b21155 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -171,7 +171,10 @@ void BareMetalDebugSupport::startExecution() StandardRunnable r; r.executable = p->executable(); - r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::OsTypeLinux); + // We need to wrap the command arguments depending on a host OS, + // as the bare metal's GDB servers are launched on a host, + // but not on a target. + r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::HostOsInfo::hostOs()); m_appRunner->start(dev, r); } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index c629b2d844d..509a17cf92d 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -967,7 +967,6 @@ public: void updateUiForProject(ProjectExplorer::Project *project); void updateUiForTarget(ProjectExplorer::Target *target); - void updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc); void updateActiveLanguages(); public: @@ -3324,12 +3323,11 @@ void DebuggerPluginPrivate::updateUiForProject(Project *project) } m_previousProject = project; if (!project) { - updateUiForTarget(0); + updateUiForTarget(nullptr); return; } connect(project, &Project::activeTargetChanged, - this, &DebuggerPluginPrivate::updateUiForTarget, - Qt::QueuedConnection); + this, &DebuggerPluginPrivate::updateUiForTarget); updateUiForTarget(project->activeTarget()); } @@ -3337,35 +3335,19 @@ void DebuggerPluginPrivate::updateUiForTarget(Target *target) { if (m_previousTarget) { disconnect(m_previousTarget.data(), &Target::activeRunConfigurationChanged, - this, &DebuggerPluginPrivate::updateUiForRunConfiguration); + this, &DebuggerPluginPrivate::updateActiveLanguages); } m_previousTarget = target; if (!target) { - updateUiForRunConfiguration(0); + updateActiveLanguages(); return; } connect(target, &Target::activeRunConfigurationChanged, - this, &DebuggerPluginPrivate::updateUiForRunConfiguration, - Qt::QueuedConnection); - updateUiForRunConfiguration(target->activeRunConfiguration()); -} - -// updates default debug language settings per run config. -void DebuggerPluginPrivate::updateUiForRunConfiguration(RunConfiguration *rc) -{ -// if (m_previousRunConfiguration) -// disconnect(m_previousRunConfiguration, &RunConfiguration::requestRunActionsUpdate, -// this, &DebuggerPluginPrivate::updateActiveLanguages); -// m_previousRunConfiguration = rc; - Q_UNUSED(rc); // FIXME + this, &DebuggerPluginPrivate::updateActiveLanguages); updateActiveLanguages(); -// if (m_previousRunConfiguration) -// connect(m_previousRunConfiguration, &RunConfiguration::requestRunActionsUpdate, -// this, &DebuggerPluginPrivate::updateActiveLanguages, -// Qt::QueuedConnection); } void DebuggerPluginPrivate::updateActiveLanguages() diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 06c73152897..2ce53c443c1 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -512,7 +512,7 @@ static QTime timeFromData(int ms) } // Stolen and adapted from qdatetime.cpp -static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time) +static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time, int tiVersion) { enum { SECS_PER_DAY = 86400, @@ -554,8 +554,8 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time) ds = msecs; } - *date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd); - *time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds); + *date = ((status & NullDate) && tiVersion < 14) ? QDate() : QDate::fromJulianDay(jd); + *time = ((status & NullTime) && tiVersion < 14) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds); } QString decodeData(const QString &ba, const QString &encoding) @@ -671,6 +671,7 @@ QString decodeData(const QString &ba, const QString &encoding) int p1 = ba.indexOf('/', p0 + 1); int p2 = ba.indexOf('/', p1 + 1); int p3 = ba.indexOf('/', p2 + 1); + int p4 = ba.indexOf('/', p3 + 1); qint64 msecs = ba.left(p0).toLongLong(); ++p0; @@ -680,11 +681,13 @@ QString decodeData(const QString &ba, const QString &encoding) ++p2; QByteArray timeZoneId = QByteArray::fromHex(ba.mid(p2, p3 - p2).toUtf8()); ++p3; - int status = ba.mid(p3).toInt(); + int status = ba.mid(p3, p4 - p3).toInt(); + ++p4; + int tiVersion = ba.mid(p4).toInt(); QDate date; QTime time; - getDateTime(msecs, status, &date, &time); + getDateTime(msecs, status, &date, &time, tiVersion); QDateTime dateTime; if (spec == Qt::OffsetFromUTC) { diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 318b73d9071..9c41249bb87 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1579,7 +1579,8 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() } QSettings *s = ICore::settings(); - s->setValue(QLatin1String("ProjectExplorer/StartupSession"), SessionManager::activeSession()); + if (!SessionManager::isDefaultVirgin()) + s->setValue(QLatin1String("ProjectExplorer/StartupSession"), SessionManager::activeSession()); s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files")); QStringList fileNames; diff --git a/tests/auto/cplusplus/lookup/tst_lookup.cpp b/tests/auto/cplusplus/lookup/tst_lookup.cpp index eaa015a4253..98af0cbc156 100644 --- a/tests/auto/cplusplus/lookup/tst_lookup.cpp +++ b/tests/auto/cplusplus/lookup/tst_lookup.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,9 @@ private slots: void templates_3(); void templates_4(); void templates_5(); + + void minimalname_data(); + void minimalname(); }; void tst_Lookup::base_class_defined_1() @@ -631,5 +635,47 @@ void tst_Lookup::templates_5() QVERIFY(doc->diagnosticMessages().isEmpty()); } +void tst_Lookup::minimalname_data() +{ + QTest::addColumn("source"); + QTest::addColumn("index"); + + QTest::newRow("inlineNamespace1") + << QByteArray("namespace std { inline namespace __cxx11 { class string{}; } }\n") + << 0; + + // This case is extracted from libstdc++ 5.4.0. + // The inline namespace is re-opened as non-inline, which is not standard + // compliant. However, gcc does this and clang only issues a warning. + QTest::newRow("inlineNamespace2") + << QByteArray("namespace std { inline namespace __cxx11 {} }\n" + "namespace std { namespace __cxx11 { class string{}; } }\n") + << 1; +} + +void tst_Lookup::minimalname() +{ + QFETCH(QByteArray, source); + QFETCH(int, index); + + Document::Ptr doc = Document::create("minimalname"); + doc->setUtf8Source(source); + doc->parse(); + doc->check(); + + Snapshot snapshot; + snapshot.insert(doc); + LookupContext ctx(doc, snapshot); + Control control; + Symbol *symbol = doc->globalSymbolAt(unsigned(index)) + ->asNamespace()->memberAt(0)->asNamespace()->memberAt(0); + + const Name *minimalName = LookupContext::minimalName(symbol, ctx.globalNamespace(), &control); + + Overview oo; + const QString minimalNameAsString = NamePrettyPrinter(&oo)(minimalName); + QCOMPARE(minimalNameAsString, QString::fromUtf8("std::string")); +} + QTEST_APPLESS_MAIN(tst_Lookup) #include "tst_lookup.moc" diff --git a/tests/auto/debugger/debugger.pro b/tests/auto/debugger/debugger.pro index 3535e9c53af..12a115c9195 100644 --- a/tests/auto/debugger/debugger.pro +++ b/tests/auto/debugger/debugger.pro @@ -1,16 +1,15 @@ TEMPLATE = subdirs -gdb.file = gdb.pro -simplifytypes.file = simplifytypes.pro +# Avoid race condition when compiling with multiple jobs or moc_predefs.h might get used and +# overridden at the same time as the sub projects are using the same build directory. +# Correct would be to completely rearrange these sub projects into sub directories, using the +# quick fix instead. +CONFIG += ordered -# avoid race condition when compiling with multiple jobs -dumpers.depends = gdb simplifytypes -dumpers.file = dumpers.pro - -SUBDIRS += gdb -SUBDIRS += simplifytypes -SUBDIRS += dumpers +SUBDIRS += gdb.pro +SUBDIRS += simplifytypes.pro +SUBDIRS += dumpers.pro SUBDIRS += namedemangler.pro SUBDIRS += disassembler.pro SUBDIRS += offsets.pro diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 80bfc538d07..a1c7e2ee8b9 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1933,8 +1933,8 @@ void tst_Dumpers::dumper_data() + CheckType("t1.(SystemLocale)", "@QString") % Optional() + Check("dt0", "(invalid)", "@QDateTime") - //+ Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") - //+ Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") + + Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") + + Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") + Check("dt1.(ISO)", "\"1980-01-01T13:15:32Z\"", "@QString") % Optional() + CheckType("dt1.(Locale)", "@QString") % Optional() diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index e3afb02afca..3c5be289742 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -386,8 +386,11 @@ def openDocument(treeElement): expected = str(item.text).split("/")[-1] if waitFor("expected in str(mainWindow.windowTitle)", 5000): return True + test.log("Expected file (%s) was not being opened in openDocument()" % expected) return False except: + t,v = sys.exc_info()[:2] + test.log("An exception occurred in openDocument(): %s(%s)" % (str(t), str(v))) return False def earlyExit(details="No additional information"): diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py index 4662edfb4e5..aac2a425211 100644 --- a/tests/system/suite_general/tst_session_handling/test.py +++ b/tests/system/suite_general/tst_session_handling/test.py @@ -129,6 +129,7 @@ def checkWelcomePage(sessionName, isCurrent=False): def checkNavigator(expectedRows, message): navigatorModel = waitForObject(":Qt Creator_Utils::NavigationTreeView").model() + waitFor("expectedRows == len(__iterateChildren__(navigatorModel, QModelIndex()))", 1000) test.compare(expectedRows, len(__iterateChildren__(navigatorModel, QModelIndex())), message) def checkOpenDocuments(expectedRows, message):