diff --git a/dist/changes-4.1.1.md b/dist/changes-4.1.1.md deleted file mode 100644 index 096afd22f29..00000000000 --- a/dist/changes-4.1.1.md +++ /dev/null @@ -1,82 +0,0 @@ -Qt Creator version 4.1.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.1.0..v4.1.1 - -General - -* Fixed issues with output pane height - (QTCREATORBUG-15986, QTCREATORBUG-16829) - -Editing - -* Fixed performance of cleaning whitespace (QTCREATORBUG-16420) -* Fixed selection color in help viewer for dark theme (QTCREATORBUG-16375) - -Help - -* Fixed that no results could be shown in Locator (QTCREATORBUG-16753) - -QMake Projects - -* Fixed issue with make steps in deploy configurations (QTCREATORBUG-16795) - -Qbs Projects - -* Fixed handling of generated files (QTCREATORBUG-16976) - -QML Support - -* Fixed handling of circular dependencies (QTCREATORBUG-16585) - -Debugging - -* Fixed scrolling in memory editor (QTCREATORBUG-16751) -* Fixed expansion of items in tool tip (QTCREATORBUG-16947) -* GDB - * Fixed handling of built-in pretty printers from new versions of GDB - (QTCREATORBUG-16758) - * Fixed that remote working directory was used for local process - (QTCREATORBUG-16211) -* CDB - * Fixed display order of vectors in vectors (QTCREATORBUG-16813) - * Fixed display of QList contents (QTCREATORBUG-16750) -* QML - * Fixed that expansion state was reset when stepping - -QML Profiler - -* Separated compile events from other QML/JS events in statistics and - flamegraph, since compilation can happen asynchronously - -Beautifier - -* Fixed that beautifier was not enabled for Objective-C/C++ files - (QTCREATORBUG-16806) - -Platform Specific - -macOS - -* Fixed issue with detecting LLDB through `xcrun` - -Android - -* Added API level 24 for Android 7 -* Fixed debugging on Android 6+ with NDK r11+ (QTCREATORBUG-16721) - -iOS - -* Fixed simulator support with Xcode 8 (QTCREATORBUG-16942) - Known issue: Qt Creator is blocked until simulator finishes starting -* Fixed that standard paths reported by QStandardPaths were wrong when - running on simulator (QTCREATORBUG-13655) -* Fixed QML debugging on device (QTCREATORBUG-15812) - -QNX - -* Fixed QML debugging (QTCREATORBUG-17208) diff --git a/dist/changes-4.2.0.md b/dist/changes-4.2.0.md index 473023cc24b..7674bd19e1a 100644 --- a/dist/changes-4.2.0.md +++ b/dist/changes-4.2.0.md @@ -17,6 +17,8 @@ General * Added Help > System Information for bug reporting purposes (QTCREATORBUG-16135) * Added option to hide the central widget in Debug mode +* Fixed issues with output pane height + (QTCREATORBUG-15986, QTCREATORBUG-16829) Welcome @@ -30,10 +32,13 @@ Editing * Added action for selecting word under cursor (QTCREATORBUG-641) * Fixed highlighting of Markdown files (QTCREATORBUG-16304) +* Fixed performance of cleaning whitespace (QTCREATORBUG-16420) +* Fixed selection color in help viewer for dark theme (QTCREATORBUG-16375) Help * Added option to open link and current page in window (QTCREATORBUG-16842) +* Fixed that no results could be shown in Locator (QTCREATORBUG-16753) All Projects @@ -50,6 +55,7 @@ QMake Projects (QTCREATORBUG-16558) * Fixed Add Library wizard when selecting library from absolute path or different drive (QTCREATORBUG-8413, QTCREATORBUG-15732, QTCREATORBUG-16688) +* Fixed issue with make steps in deploy configurations (QTCREATORBUG-16795) CMake Projects @@ -64,6 +70,7 @@ CMake Projects Qbs Projects * Made generated files available in project tree (QTCREATORBUG-15978) +* Fixed handling of generated files (QTCREATORBUG-16976) C++ Support @@ -78,16 +85,37 @@ C++ Support * Added notification for parsing errors in headers * Improved responsiveness of completion and highlighting +QML Support + +* Fixed handling of circular dependencies (QTCREATORBUG-16585) + Debugging * Added pretty printing of `QRegExp` captures, `QStaticStringData`, - `QStandardItem`, and `std::pair` + `QStandardItem`, `std::weak_ptr`, `std::__1::multiset`, + and `std::pair` +* Added display of QObject hierarchy and properties in release builds +* Added support to pretty-print custom types without debug info +* Enhanced display of function pointers * Improved pretty printing of QV4 types -* Made display of maps more compact +* Made display of associative containers, pairs, and various smart + pointers more compact +* Made creation of custom pretty printers easier * Fixed pretty printing of `QFixed` +* Fixed scrolling in memory editor (QTCREATORBUG-16751) +* Fixed expansion of items in tool tip (QTCREATORBUG-16947) +* GDB + * Fixed handling of built-in pretty printers from new versions of GDB + (QTCREATORBUG-16758) + * Fixed that remote working directory was used for local process + (QTCREATORBUG-16211) * LLDB * Added support for Qt Creator variables `%{...}` in startup commands +* CDB + * Fixed display order of vectors in vectors (QTCREATORBUG-16813) + * Fixed display of QList contents (QTCREATORBUG-16750) * QML + * Fixed that expansion state was reset when stepping * Fixed `Load QML Stack` with Qt 5.7 and later (QTCREATORBUG-17097) QML Profiler @@ -95,6 +123,8 @@ QML Profiler * Added option to show memory usage and allocations as flame graph * Added option to show vertical orientation lines in timeline (click the time ruler) +* Separated compile events from other QML/JS events in statistics and + flamegraph, since compilation can happen asynchronously Qt Quick Designer @@ -142,6 +172,11 @@ Model Editor * Added zooming * Added synchronization of selected diagram in diagram browser +Beautifier + +* Fixed that beautifier was not enabled for Objective-C/C++ files + (QTCREATORBUG-16806) + Platform Specific Windows @@ -150,9 +185,15 @@ Windows * Fixed that environment variables containing special characters were not passed correctly to user applications (QTCREATORBUG-17219) +macOS + +* Fixed issue with detecting LLDB through `xcrun` + Android +* Added API level 24 for Android 7 * Improved stability of determination if application is running +* Fixed debugging on Android 6+ with NDK r11+ (QTCREATORBUG-16721) * Fixed that running without deployment did not start emulator (QTCREATORBUG-10237) * Fixed that permission model downgrade was not detected as error @@ -161,12 +202,19 @@ Android iOS -* Fixed that Qt Creator was blocked until simulator finished starting +* Fixed simulator support with Xcode 8 (QTCREATORBUG-16942) +* Fixed that standard paths reported by QStandardPaths were wrong when + running on simulator (QTCREATORBUG-13655) +* Fixed QML debugging on device (QTCREATORBUG-15812) Remote Linux * Fixed crash when creating SSH key pair (QTCREATORBUG-17349) +QNX + +* Fixed QML debugging (QTCREATORBUG-17208) + Credits for these changes go to: Aaron Barany Alessandro Portale diff --git a/dist/appdata.xml b/dist/org.qt-project.qtcreator.appdata.xml similarity index 71% rename from dist/appdata.xml rename to dist/org.qt-project.qtcreator.appdata.xml index b96ba959bce..ef8663f6572 100644 --- a/dist/appdata.xml +++ b/dist/org.qt-project.qtcreator.appdata.xml @@ -1,8 +1,9 @@ - - qtcreator.desktop - CC-BY-SA + + org.qt-project.qtcreator.desktop + CC0-1.0 + GPL-3.0

Qt Creator provides a cross-platform, complete integrated development @@ -20,9 +21,7 @@ newcomers to Qt.

- - http://qt-project.org/uploads/image_upload/qtcreator-edit-mode.png - - https://wiki.qt.io/Category:Tools::QtCreator + + https://qt.io/ide/ Qt -
+ diff --git a/dist/org.qt-project.qtcreator.desktop b/dist/org.qt-project.qtcreator.desktop new file mode 100644 index 00000000000..26c0aa58bba --- /dev/null +++ b/dist/org.qt-project.qtcreator.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Exec=qtcreator %F +Name=Qt Creator +GenericName=C++ IDE for developing Qt applications +X-KDE-StartupNotify=true +Icon=QtProject-qtcreator +Terminal=false +Categories=Development;IDE;Qt; +MimeType= text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.qt.qmakeprofile;application/vnd.qt.xml.resource; + diff --git a/qtcreator.pro b/qtcreator.pro index b71317061b3..ebcd9d7223a 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -93,6 +93,16 @@ isEmpty(BASENAME): BASENAME = qt-creator-$${PLATFORM}$(INSTALL_EDITION)-$${QTCRE macx:INSTALLER_NAME = "qt-creator-$${QTCREATOR_VERSION}" else:INSTALLER_NAME = "$${BASENAME}" +linux { + appstream.files = dist/org.qt-project.qtcreator.appdata.xml + appstream.path = $$QTC_PREFIX/share/metainfo/ + + desktop.files = dist/org.qt-project.qtcreator.desktop + desktop.path = $$QTC_PREFIX/share/applications/ + + INSTALLS += appstream desktop +} + macx { APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app" BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app" @@ -109,7 +119,10 @@ macx { deployqt.depends = install win32 { deployartifacts.depends = install - deployartifacts.commands = git clone "git://code.qt.io/qt-creator/binary-artifacts.git" -b $$BINARY_ARTIFACTS_BRANCH&& xcopy /s /q /y /i "binary-artifacts\\win32" \"$(INSTALL_ROOT)$$QTC_PREFIX\"&& rmdir /s /q binary-artifacts + deployartifacts.commands = git clone --depth 1 -b $$BINARY_ARTIFACTS_BRANCH \ + "http://code.qt.io/qt-creator/binary-artifacts.git" \ + && xcopy /s /q /y /i "binary-artifacts\\win32" \"$(INSTALL_ROOT)$$QTC_PREFIX\" \ + && rmdir /s /q binary-artifacts QMAKE_EXTRA_TARGETS += deployartifacts } } diff --git a/scripts/common.py b/scripts/common.py index 22fcca98720..388ce487fdb 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -24,10 +24,13 @@ ############################################################################ import os +import locale import shutil import subprocess import sys +encoding = locale.getdefaultlocale()[1] + def is_windows_platform(): return sys.platform.startswith('win') @@ -88,7 +91,7 @@ def copytree(src, dst, symlinks=False, ignore=None): def get_qt_install_info(qmake_bin): output = subprocess.check_output([qmake_bin, '-query']) - lines = output.strip().split('\n') + lines = output.decode(encoding).strip().split('\n') info = {} for line in lines: (var, sep, value) = line.partition(':') @@ -103,7 +106,7 @@ def get_rpath(libfilepath, chrpath=None): except subprocess.CalledProcessError: # no RPATH or RUNPATH return [] marker = 'RPATH=' - index = output.find(marker) + index = output.decode(encoding).find(marker) if index < 0: marker = 'RUNPATH=' index = output.find(marker) @@ -127,7 +130,7 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None): # check for Qt linking lddOutput = subprocess.check_output(['ldd', filepath]) - if lddOutput.find('libQt5') >= 0 or lddOutput.find('libicu') >= 0: + if lddOutput.decode(encoding).find('libQt5') >= 0 or lddOutput.find('libicu') >= 0: # add Qt RPATH if necessary relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath)) if relative_path == '.': diff --git a/scripts/createDevPackage.py b/scripts/createDevPackage.py index 09f729a7122..b0b3837fb31 100755 --- a/scripts/createDevPackage.py +++ b/scripts/createDevPackage.py @@ -57,8 +57,9 @@ def parse_arguments(): source_include_patterns = [ # directories - r"^scripts/.*$", # everything under scripts/ - r"^src/(.*/)?$", # all directories under src/ + r"^scripts/.*$", # everything under scripts/ + r"^src/(.*/)?$", # all directories under src/ + r"^plugins/(.*/)?$", # all directories under plugins/ (if this is run on extra plugin repositories) # files r"^HACKING$", r"^LICENSE.*$", @@ -107,12 +108,6 @@ def copy_regexp(regexp, source_directory, target_directory, verbose): common.copytree(source_directory, target_directory, symlinks=True, ignore=ignore) def sanity_check_arguments(arguments): - if not os.path.isfile(os.path.join(arguments.source, 'qtcreator.pri')): - print('error: did not find qtcreator.pri at "{0}"'.format(arguments.source)) - return False - if not os.path.isfile(os.path.join(arguments.build, 'src', 'app', 'app_version.h')): - print('error: did not find src/app/app_version.h at "{0}"'.format(arguments.build)) - return False if os.path.exists(arguments.target_directory) and (os.path.isfile(arguments.target_directory) or len(os.listdir(arguments.target_directory)) > 0): print('error: target directory "{0}" exists and is not empty'.format(arguments.target_directory)) diff --git a/scripts/deployqt.py b/scripts/deployqt.py index d2c2e7abac3..8e7fa8ba47a 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -28,6 +28,7 @@ ################################################################################ import os +import locale import sys import getopt import subprocess @@ -39,9 +40,10 @@ import common ignoreErrors = False debug_build = False +encoding = locale.getdefaultlocale()[1] def usage(): - print "Usage: %s [qmake_path]" % os.path.basename(sys.argv[0]) + print("Usage: %s [qmake_path]" % os.path.basename(sys.argv[0])) def which(program): def is_exe(fpath): @@ -73,14 +75,14 @@ def is_debug(fpath): if coredebug.search(fpath): return True output = subprocess.check_output(['dumpbin', '/imports', fpath]) - return coredebug.search(output) != None + return coredebug.search(output.decode(encoding)) != None def is_debug_build(install_dir): return is_debug(os.path.join(install_dir, 'bin', 'qtcreator.exe')) def op_failed(details = None): if details != None: - print details + print(details) if ignoreErrors == False: print("Error: operation failed!") sys.exit(2) @@ -108,7 +110,7 @@ def ignored_qt_lib_files(path, filenames): return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)] def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_dir, plugins, imports): - print "copying Qt libraries..." + print("copying Qt libraries...") if common.is_windows_platform(): libraries = glob(os.path.join(qt_libs_dir, '*.dll')) @@ -127,7 +129,7 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, libraries = [lib for lib in libraries if not is_ignored_windows_file(debug_build, '', lib)] for library in libraries: - print library, '->', lib_dest + print(library, '->', lib_dest) if os.path.islink(library): linkto = os.readlink(library) try: @@ -137,7 +139,7 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, else: shutil.copy(library, lib_dest) - print "Copying plugins:", plugins + print("Copying plugins:", plugins) for plugin in plugins: target = os.path.join(target_qt_prefix_path, 'plugins', plugin) if (os.path.exists(target)): @@ -147,7 +149,7 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, print('{0} -> {1}'.format(pluginPath, target)) common.copytree(pluginPath, target, ignore=ignored_qt_lib_files, symlinks=True) - print "Copying imports:", imports + print("Copying imports:", imports) for qtimport in imports: target = os.path.join(target_qt_prefix_path, 'imports', qtimport) if (os.path.exists(target)): @@ -158,14 +160,14 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, common.copytree(import_path, target, ignore=ignored_qt_lib_files, symlinks=True) if (os.path.exists(qt_qml_dir)): - print "Copying qt quick 2 imports" + print("Copying qt quick 2 imports") target = os.path.join(target_qt_prefix_path, 'qml') if (os.path.exists(target)): shutil.rmtree(target) print('{0} -> {1}'.format(qt_qml_dir, target)) common.copytree(qt_qml_dir, target, ignore=ignored_qt_lib_files, symlinks=True) - print "Copying qtdiag" + print("Copying qtdiag") bin_dest = target_qt_prefix_path if common.is_windows_platform() else os.path.join(target_qt_prefix_path, 'bin') qtdiag_src = os.path.join(qt_bin_dir, 'qtdiag.exe' if common.is_windows_platform() else 'qtdiag') if not os.path.exists(bin_dest): @@ -191,9 +193,9 @@ def copy_translations(install_dir, qt_tr_dir): translations = glob(os.path.join(qt_tr_dir, '*.qm')) tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations') - print "copying translations..." + print("copying translations...") for translation in translations: - print translation, '->', tr_dir + print(translation, '->', tr_dir) shutil.copy(translation, tr_dir) def copyPreservingLinks(source, destination): @@ -240,21 +242,21 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): os.path.join(clangbinary_targetdir, linktarget))) resourcetarget = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib', 'clang') - print "copying libclang..." + print("copying libclang...") for source, target in deployinfo: - print source, '->', target + print(source, '->', target) copyPreservingLinks(source, target) if common.is_linux_platform(): # libclang was statically compiled, so there is no need for the RPATHs # and they are confusing when fixing RPATHs later in the process - print "removing libclang RPATHs..." + print("removing libclang RPATHs...") for source, target in deployinfo: if not os.path.islink(target): targetfilepath = target if not os.path.isdir(target) else os.path.join(target, os.path.basename(source)) subprocess.check_call([chrpath_bin, '-d', targetfilepath]) - print resourcesource, '->', resourcetarget + print(resourcesource, '->', resourcetarget) if (os.path.exists(resourcetarget)): shutil.rmtree(resourcetarget) common.copytree(resourcesource, resourcetarget, symlinks=True) @@ -272,7 +274,7 @@ def main(): if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True - print "Note: Ignoring all errors" + print("Note: Ignoring all errors") if len(args) < 1: usage() @@ -289,14 +291,14 @@ def main(): qmake_bin = which(qmake_bin) if qmake_bin == None: - print "Cannot find required binary 'qmake'." + print("Cannot find required binary 'qmake'.") sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: - print "Cannot find required binary 'chrpath'." + print("Cannot find required binary 'chrpath'.") sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) @@ -323,7 +325,7 @@ def main(): deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if not common.is_windows_platform(): - print "fixing rpaths..." + print("fixing rpaths...") common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), qt_deploy_prefix) # e.g. for qml2puppet add_qt_conf(os.path.join(qt_deploy_prefix, 'bin'), qt_deploy_prefix) # e.g. qtdiag @@ -331,7 +333,7 @@ def main(): if __name__ == "__main__": if common.is_mac_platform(): - print "Mac OS is not supported by this script, please use macqtdeploy!" + print("macOS is not supported by this script, please use macqtdeploy!") sys.exit(2) else: main() diff --git a/scripts/msanalyzer2tasks.pl b/scripts/msanalyzer2tasks.pl new file mode 100755 index 00000000000..f8080c34b37 --- /dev/null +++ b/scripts/msanalyzer2tasks.pl @@ -0,0 +1,122 @@ +#!/usr/bin/perl -w + +############################################################################ +# +# Copyright (C) 2016 The Qt Company Ltd. +# Contact: https://www.qt.io/licensing/ +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and The Qt Company. For licensing terms +# and conditions see https://www.qt.io/terms-conditions. For further +# information use the contact form at https://www.qt.io/contact-us. +# +# GNU General Public License Usage +# Alternatively, this file may be used under the terms of the GNU +# General Public License version 3 as published by the Free Software +# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +# included in the packaging of this file. Please review the following +# information to ensure the GNU General Public License requirements will +# be met: https://www.gnu.org/licenses/gpl-3.0.html. +# +############################################################################ + +=head1 NAME + +msanalyzer2tasks.pl - Convert MSVC/Static analyzer warnings and errors into Qt Creator task files. + +=head1 SYNOPSIS + + msanalyzer2tasks.pl < logfile > taskfile + +=cut + +# Sample: +# +# +# +# c:\dev\qt5\qtbase\src\corelib\statemachine\ +# qstatemachine.cpp +# 968 +# 21 +# +# 6246 +# Local declaration of 'i' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '953' of 'c:\dev\qt5\qtbase\src\corelib\statemachine\qstatemachine.cpp'. +# QStateMachinePrivate::enterStates +# ?enterStates@QStateMachinePrivate@@UAEXPAVQEvent@@ABV?$QList@PAVQAbstractState@@@@1ABV?$QSet@PAVQAbstractState@@@@AAV?$QHash@PAVQAbstractState@@V?$QVector@UQPropertyAssignment@@@@@@ABV?$QList@PAVQAbstractAnimation@@@@@Z +# 941 +# +# +# c:\dev\qt5\qtbase\src\corelib\statemachine\ +# qstatemachine.cpp +# 953 +# 18 +# +# +# +# + +use strict; + +my ($description, $defectCode); +my (@filePaths, @fileNames, @lineNumbers); + +# Return element contents of a line "Contents" +sub elementContents +{ + my ($line) = @_; + return $line =~ /^ *<([^>]*)>([^<]*)<\/.*$/ + ? ($1, $2) : (undef, undef) +} + +# Fix path 'c:\foo\' -> 'c:/foo' +sub fixFilePath +{ + my ($p) = @_; + $p =~ s|\\|/|g; + my $lastSlash = rindex($p, '/'); + chop($p) if $lastSlash == length($p) - 1; + return $p; +} + +# Fix message (replace XML entities, backslash) +sub fixMessage +{ + my ($m) = @_; + $m =~ s|\\|/|g; + $m =~ s/<//g; + $m =~ s/&/&/g; + return $m; +} + +while (my $line = ) { + chomp($line); + my ($element, $content) = elementContents($line); + if (defined($element)) { + if ($element eq 'FILEPATH') { + push(@filePaths, fixFilePath($content)); + } elsif ($element eq 'FILENAME') { + push(@fileNames, $content); + } elsif ($element eq 'LINE') { + push(@lineNumbers, $content); + } elsif ($element eq 'DESCRIPTION') { + $description = fixMessage($content); + } elsif ($element eq 'DEFECTCODE') { + $defectCode = $content; + } + } elsif (index($line, '') >= 0) { + my $count = scalar(@filePaths); + for (my $i = 0; $i < $count; $i++) { + my $text = $description; + $text .= ' (' . $defectCode . ')' if defined $defectCode; + print $filePaths[$i], '/', $fileNames[$i], "\t", $lineNumbers[$i], "\twarn\t", $text,"\n"; + } + $description = $defectCode = undef; + @filePaths = @fileNames= @lineNumbers = (); + } +} diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 5c802eea335..9e2bcc4ce67 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -472,6 +472,9 @@ class DumperBase: self.cachedFormats[typeName] = stripped return stripped + def templateArgument(self, typeobj, position): + return typeobj.templateArgument(position) + def intType(self): result = self.lookupType('int') self.intType = lambda: result @@ -1858,7 +1861,7 @@ class DumperBase: for i in range(propertyCount): t = self.split('III', dataPtr + properties * 4 + 12 * i) name = self.metaString(metaObjectPtr, t[0], revision) - if qobject: + if qobject and self.qtPropertyFunc: # LLDB doesn't like calling it on a derived class, possibly # due to type information living in a different shared object. #base = self.createValue(qobjectPtr, '@QObject') @@ -1875,6 +1878,10 @@ class DumperBase: continue #warn('COULD NOT EXECUTE: %s' % cmd) #self.putCallItem(name, '@QVariant', base, 'property', '"' + name + '"') + if res is None: + self.bump('failedMetaObjectCall2') + putt(name, ' ') + continue self.putSubItem(name, res) else: putt(name, ' ') @@ -2876,9 +2883,12 @@ class DumperBase: elif isinstance(index, self.dumper.Field): field = index elif self.dumper.isInt(index): - if self.type.code in (TypeCodeArray, TypeCodePointer): - itemAddress = self.laddress + int(index) * self.type.ltarget.size() - return self.dumper.createValue(itemAddress, self.type.ltarget) + if self.type.code == TypeCodeArray: + addr = self.laddress + int(index) * self.type.ltarget.size() + return self.dumper.createValue(addr, self.type.ltarget) + if self.type.code == TypeCodePointer: + addr = self.pointer() + int(index) * self.type.ltarget.size() + return self.dumper.createValue(addr, self.type.ltarget) return self.members(False)[index] else: error('BAD INDEX TYPE %s' % type(index)) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index dcb48f7a496..ce828398cb0 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1049,7 +1049,7 @@ class Dumper(DumperBase): sym += '@plt' self.qtCustomEventPltFunc = self.findSymbol(sym) - sym = '_ZNK7%sQObject8propertyEPKc' % strns + sym = '_ZNK%s7QObject8propertyEPKc' % strns self.qtPropertyFunc = self.findSymbol(sym) # This might be wrong, but we can't do better: We found diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index 0abab3713a8..3550a3def58 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -341,3 +341,11 @@ def qdump__WTF__String(d, value): def qdump__QtcDumperTest_FieldAccessByIndex(d, value): d.putValue(value["d"][2].integer()) +def qdump__QtcDumperTest_PointerArray(d, value): + foos = value["foos"] + d.putItemCount(10) + if d.isExpanded(): + with Children(d, 10): + for i in d.childRange(): + d.putSubItem(i, foos[i]) + diff --git a/src/libs/timeline/timelineitemsrenderpass.cpp b/src/libs/timeline/timelineitemsrenderpass.cpp index fdcd9ecfc43..56e633dd139 100644 --- a/src/libs/timeline/timelineitemsrenderpass.cpp +++ b/src/libs/timeline/timelineitemsrenderpass.cpp @@ -296,6 +296,7 @@ void TimelineItemsGeometry::allocate(QSGMaterial *material) { QSGGeometry *geometry = new QSGGeometry(OpaqueColoredPoint2DWithSize::attributes(), usedVertices); + Q_ASSERT(geometry->vertexData()); geometry->setIndexDataPattern(QSGGeometry::StaticPattern); geometry->setVertexDataPattern(QSGGeometry::StaticPattern); node = new QSGGeometryNode; diff --git a/src/libs/timeline/timelinenotesrenderpass.cpp b/src/libs/timeline/timelinenotesrenderpass.cpp index f630c144c24..d18c1e16fe6 100644 --- a/src/libs/timeline/timelinenotesrenderpass.cpp +++ b/src/libs/timeline/timelinenotesrenderpass.cpp @@ -196,6 +196,7 @@ QSGGeometry *NotesGeometry::createGeometry(QVector &ids, const TimelineMode float rowHeight = TimelineModel::defaultRowHeight(); QSGGeometry *geometry = new QSGGeometry(point2DWithDistanceFromTop(), ids.count() * 2); + Q_ASSERT(geometry->vertexData()); geometry->setDrawingMode(GL_LINES); geometry->setLineWidth(3); Point2DWithDistanceFromTop *v = diff --git a/src/libs/timeline/timelineselectionrenderpass.cpp b/src/libs/timeline/timelineselectionrenderpass.cpp index b4ef8d9292f..c9953be53ef 100644 --- a/src/libs/timeline/timelineselectionrenderpass.cpp +++ b/src/libs/timeline/timelineselectionrenderpass.cpp @@ -36,6 +36,7 @@ QSGGeometryNode *createSelectionNode(QSGMaterial *material) selectionNode->setMaterial(material); selectionNode->setFlag(QSGNode::OwnsMaterial, false); QSGGeometry *geometry = new QSGGeometry(OpaqueColoredPoint2DWithSize::attributes(), 4); + Q_ASSERT(geometry->vertexData()); geometry->setDrawingMode(GL_TRIANGLE_STRIP); OpaqueColoredPoint2DWithSize *v = OpaqueColoredPoint2DWithSize::fromVertexData(geometry); for (int i = 0; i < 4; ++i) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index ac17f9662ed..0f5173c8a9b 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -544,6 +544,8 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos) void TestResultsPane::onCopyItemTriggered(const QModelIndex &idx) { + if (!idx.isValid()) + return; const TestResult *result = m_filterModel->testResult(idx); QTC_ASSERT(result, return); QApplication::clipboard()->setText(result->outputString(true)); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 732c7271e1c..d332a20cd8f 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1488,6 +1488,9 @@ void EditorManagerPrivate::setCurrentEditor(IEditor *editor, bool ignoreNavigati if (d->m_currentEditor == editor) return; + + emit m_instance->currentEditorAboutToChange(d->m_currentEditor); + if (d->m_currentEditor && !ignoreNavigationHistory) EditorManager::addCurrentPositionToNavigationHistory(); diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index cbefff451f8..308e7607913 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -189,6 +189,7 @@ signals: void findOnFileSystemRequest(const QString &path); void aboutToSave(IDocument *document); void autoSaved(); + void currentEditorAboutToChange(Core::IEditor *editor); public slots: static void saveDocument(); diff --git a/src/plugins/coreplugin/messagebox.cpp b/src/plugins/coreplugin/messagebox.cpp index 1dfebd10080..9eb636f16b7 100644 --- a/src/plugins/coreplugin/messagebox.cpp +++ b/src/plugins/coreplugin/messagebox.cpp @@ -34,7 +34,7 @@ namespace AsynchronousMessageBox { namespace { -void message(QMessageBox::Icon icon, const QString &title, const QString &desciption) +QWidget *message(QMessageBox::Icon icon, const QString &title, const QString &desciption) { QMessageBox *messageBox = new QMessageBox(icon, title, @@ -45,23 +45,24 @@ void message(QMessageBox::Icon icon, const QString &title, const QString &descip messageBox->setAttribute(Qt::WA_DeleteOnClose); messageBox->setModal(true); messageBox->show(); + return messageBox; } } -void warning(const QString &title, const QString &desciption) +QWidget *warning(const QString &title, const QString &desciption) { - message(QMessageBox::Warning, title, desciption); + return message(QMessageBox::Warning, title, desciption); } -void information(const QString &title, const QString &desciption) +QWidget *information(const QString &title, const QString &desciption) { - message(QMessageBox::Information, title, desciption); + return message(QMessageBox::Information, title, desciption); } -void critical(const QString &title, const QString &desciption) +QWidget *critical(const QString &title, const QString &desciption) { - message(QMessageBox::Critical, title, desciption); -} + return message(QMessageBox::Critical, title, desciption); } } +} diff --git a/src/plugins/coreplugin/messagebox.h b/src/plugins/coreplugin/messagebox.h index b679636d1f8..32c60dd6831 100644 --- a/src/plugins/coreplugin/messagebox.h +++ b/src/plugins/coreplugin/messagebox.h @@ -29,13 +29,15 @@ QT_BEGIN_NAMESPACE class QString; +class QWidget; QT_END_NAMESPACE namespace Core { namespace AsynchronousMessageBox { - CORE_EXPORT void warning(const QString &title, const QString &desciption); - CORE_EXPORT void information(const QString &title, const QString &desciption); - CORE_EXPORT void critical(const QString &title, const QString &desciption); +CORE_EXPORT QWidget *warning(const QString &title, const QString &desciption); +CORE_EXPORT QWidget *information(const QString &title, const QString &desciption); +CORE_EXPORT QWidget *critical(const QString &title, const QString &desciption); + } } diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 5193aae6214..ef82c06f296 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -383,6 +383,7 @@ public: // Safety net to avoid infinite lookups. QSet m_lookupRequests; // FIXME: Integrate properly. + QPointer m_alertBox; }; @@ -1825,8 +1826,11 @@ QString DebuggerEngine::msgInterrupted() return tr("Interrupted."); } -void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) +bool DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) { + if (d->m_alertBox) + return false; + if (name.isEmpty()) name = ' ' + tr("", "name") + ' '; if (meaning.isEmpty()) @@ -1836,7 +1840,9 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name "" "
Signal name : %1
Signal meaning : %2
") .arg(name, meaning); - AsynchronousMessageBox::information(tr("Signal Received"), msg); + + d->m_alertBox = AsynchronousMessageBox::information(tr("Signal Received"), msg); + return true; } void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index b1665989bee..ca51aa5b321 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -430,7 +430,7 @@ protected: static QString msgStoppedByException(const QString &description, const QString &threadId); static QString msgInterrupted(); - void showStoppedBySignalMessageBox(const QString meaning, QString name); + bool showStoppedBySignalMessageBox(const QString meaning, QString name); void showStoppedByExceptionMessageBox(const QString &description); bool isStateDebugging() const; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2d5bc7375e4..e5da59b034d 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1634,7 +1634,10 @@ void GdbEngine::handleStop2(const GdbMi &data) } else { showMessage("HANDLING SIGNAL " + name); if (boolSetting(UseMessageBoxForSignals) && !isStopperThread) - showStoppedBySignalMessageBox(meaning, name); + if (!showStoppedBySignalMessageBox(meaning, name)) { + showMessage("SIGNAL RECEIVED WHILE SHOWING SIGNAL MESSAGE"); + return; + } if (!name.isEmpty() && !meaning.isEmpty()) reasontr = msgStoppedBySignal(meaning, name); } diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 3b60bfad401..118cbc18b47 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -8680,6 +8680,11 @@ void FakeVimHandler::handleInput(const QString &keys) d->leaveFakeVim(); } +void FakeVimHandler::enterCommandMode() +{ + d->enterCommandMode(); +} + void FakeVimHandler::setCurrentFileName(const QString &fileName) { d->m_currentFileName = fileName; diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index 6f218421e0d..92b9249735e 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -106,6 +106,7 @@ public: void handleCommand(const QString &cmd); void handleReplay(const QString &keys); void handleInput(const QString &keys); + void enterCommandMode(); void installEventFilter(); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index c3d288efb85..c3b78dab266 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1035,6 +1035,7 @@ private: void onCoreAboutToClose(); void editorOpened(Core::IEditor *); void editorAboutToClose(Core::IEditor *); + void currentEditorAboutToChange(Core::IEditor *); void allDocumentsRenamed(const QString &oldName, const QString &newName); void documentRenamed(Core::IDocument *document, const QString &oldName, const QString &newName); @@ -1246,6 +1247,8 @@ bool FakeVimPluginPrivate::initialize() this, &FakeVimPluginPrivate::editorAboutToClose); connect(EditorManager::instance(), &EditorManager::editorOpened, this, &FakeVimPluginPrivate::editorOpened); + connect(EditorManager::instance(), &EditorManager::currentEditorAboutToChange, + this, &FakeVimPluginPrivate::currentEditorAboutToChange); connect(DocumentManager::instance(), &DocumentManager::allDocumentsRenamed, this, &FakeVimPluginPrivate::allDocumentsRenamed); @@ -1841,6 +1844,12 @@ void FakeVimPluginPrivate::editorAboutToClose(IEditor *editor) m_editorToHandler.remove(editor); } +void FakeVimPluginPrivate::currentEditorAboutToChange(IEditor *editor) +{ + if (FakeVimHandler *handler = m_editorToHandler.value(editor, 0)) + handler->enterCommandMode(); +} + void FakeVimPluginPrivate::allDocumentsRenamed(const QString &oldName, const QString &newName) { renameFileNameInEditors(oldName, newName); diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp index 754061d0153..b715ab0b29b 100644 --- a/src/plugins/ios/iosdebugsupport.cpp +++ b/src/plugins/ios/iosdebugsupport.cpp @@ -169,8 +169,6 @@ IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig, m_runner, &IosRunner::start); connect(m_runControl, &RunControl::finished, m_runner, &IosRunner::stop); - connect(m_runControl, &DebuggerRunControl::stateChanged, - m_runner, &IosRunner::debuggerStateChanged); connect(m_runner, &IosRunner::gotServerPorts, this, &IosDebugSupport::handleServerPorts); diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index c8ece1871b9..75f83a243e2 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -168,12 +168,6 @@ void IosRunner::stop() } } -void IosRunner::debuggerStateChanged(Debugger::DebuggerState state) -{ - if (m_toolHandler) - m_toolHandler->debuggerStateChanged(state); -} - void IosRunner::handleDidStartApp(IosToolHandler *handler, const QString &bundlePath, const QString &deviceId, IosToolHandler::OpStatus status) { diff --git a/src/plugins/ios/iosrunner.h b/src/plugins/ios/iosrunner.h index d798b521eb2..2d41ff45457 100644 --- a/src/plugins/ios/iosrunner.h +++ b/src/plugins/ios/iosrunner.h @@ -65,9 +65,6 @@ public: void start(); void stop(); -public slots: - void debuggerStateChanged(Debugger::DebuggerState state); - signals: void didStartApp(Ios::IosToolHandler::OpStatus status); void gotServerPorts(Utils::Port gdbPort, Utils::Port qmlPort); diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 3af160caddc..b12df9be16c 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -34,6 +34,7 @@ #include #include #include "utils/runextensions.h" +#include "utils/synchronousprocess.h" #include #include @@ -141,7 +142,6 @@ public: bool isRunning(); void start(const QString &exe, const QStringList &args); virtual void stop(int errorCode) = 0; - virtual void debuggerStateChanged(Debugger::DebuggerState state) { Q_UNUSED(state); } // signals void isTransferringApp(const QString &bundlePath, const QString &deviceId, int progress, @@ -230,20 +230,10 @@ private: * YES | * | | * v | - * +---------+-------------------------+ | - * | SimulatorControl::spawnAppProcess | <------------------+ - * +-----------------------------------+ - * | - * v - * +--------+-----------+ +-----------------------------+ - * | Debug Run ? +---YES------> + Wait for debugger to attach | - * +---------+----------+ +-----------+-----------------+ - * NO | - * | | - * v | - * +-----------------------------+ | - * | SimulatorControl::launchApp | <-------------------+ - * +-----------------------------+ + * +---------+------------------------------+ | + * | SimulatorControl::launchAppOnSimulator | <-------------+ + * +----------------------------------------+ + * ***************************************************************************/ class IosSimulatorToolHandlerPrivate : public IosToolHandlerPrivate { @@ -260,15 +250,11 @@ public: const QString &deviceIdentifier, int timeout = 1000) override; void requestDeviceInfo(const QString &deviceId, int timeout = 1000) override; void stop(int errorCode) override; - void debuggerStateChanged(Debugger::DebuggerState state) override; private: void installAppOnSimulator(); - void spawnAppOnSimulator(const QStringList &extraArgs); - void launchAppOnSimulator(); - + void launchAppOnSimulator(const QStringList &extraArgs); bool isResponseValid(const SimulatorControl::ResponseData &responseData); - void onResponseAppSpawn(const SimulatorControl::ResponseData &response); void simAppProcessError(QProcess::ProcessError error); void simAppProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); @@ -277,7 +263,6 @@ private: private: qint64 appPId = -1; - bool appLaunched = false; SimulatorControl *simCtl; QList> futureList; }; @@ -802,7 +787,7 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath, if (isResponseValid(response)) return; if (response.success) { - spawnAppOnSimulator(extraArgs); + launchAppOnSimulator(extraArgs); } else { errorMsg(IosToolHandler::tr("Application launch on Simulator failed. Simulator not running.") .arg(bundlePath)); @@ -811,7 +796,7 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath, }; if (SimulatorControl::isSimulatorRunning(deviceId)) - spawnAppOnSimulator(extraArgs); + launchAppOnSimulator(extraArgs); else futureList << Utils::onResultReady(simCtl->startSimulator(deviceId), onSimulatorStart); } @@ -824,14 +809,7 @@ void IosSimulatorToolHandlerPrivate::requestDeviceInfo(const QString &deviceId, void IosSimulatorToolHandlerPrivate::stop(int errorCode) { - - if (process) { - QTC_ASSERT(process.unique(), process->kill(); qCDebug(toolHandlerLog)<<"App process is not unique."); - process.reset(); - appPId = -1; - appLaunched = false; - } - + appPId = -1; foreach (auto f, futureList) { if (!f.isFinished()) f.cancel(); @@ -841,14 +819,6 @@ void IosSimulatorToolHandlerPrivate::stop(int errorCode) q->finished(q); } -void IosSimulatorToolHandlerPrivate::debuggerStateChanged(Debugger::DebuggerState state) -{ - if (!appLaunched && state == Debugger::DebuggerState::InferiorRunOk) { - // Debugger attached. Launch it on the simulator. - launchAppOnSimulator(); - } -} - void IosSimulatorToolHandlerPrivate::installAppOnSimulator() { auto onResponseAppInstall = [this](const SimulatorControl::ResponseData &response) { @@ -871,23 +841,32 @@ void IosSimulatorToolHandlerPrivate::installAppOnSimulator() onResponseAppInstall); } -void IosSimulatorToolHandlerPrivate::spawnAppOnSimulator(const QStringList &extraArgs) +void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &extraArgs) { - Utils::FileName appBundle = Utils::FileName::fromString(bundlePath); - bool debugRun = runKind == IosToolHandler::DebugRun; - futureList << Utils::onResultReady(simCtl->spawnAppProcess(deviceId, appBundle, debugRun, extraArgs), - std::bind(&IosSimulatorToolHandlerPrivate::onResponseAppSpawn, this, _1)); -} + auto monitorPid = [this](QFutureInterface &fi, qint64 pid) { + int exitCode = 0; + const QStringList args({QStringLiteral("-0"), QString::number(pid)}); + Utils::SynchronousProcess pKill; + while (!fi.isCanceled() && exitCode == 0) { + // Poll every 1 sec to check whether the app is running. + QThread::msleep(1000); + Utils::SynchronousProcessResponse resp = pKill.runBlocking(QStringLiteral("kill"), args); + exitCode = resp.exitCode; + } + // Future is cancelled if the app is stopped from the qt creator. + if (!fi.isCanceled()) + stop(0); + }; -void IosSimulatorToolHandlerPrivate::launchAppOnSimulator() -{ - auto onResponseAppLaunch = [this](const SimulatorControl::ResponseData &response) { + auto onResponseAppLaunch = [this, monitorPid](const SimulatorControl::ResponseData &response) { if (!isResponseValid(response)) return; - - if (response.pID != -1) { - appLaunched = true; + if (response.success) { + appPId = response.pID; + gotInferiorPid(bundlePath, deviceId, appPId); didStartApp(bundlePath, deviceId, Ios::IosToolHandler::Success); + // Start monitoring app's life signs. + futureList << Utils::runAsync(monitorPid, appPId); } else { errorMsg(IosToolHandler::tr("Application launch on Simulator failed. %1") .arg(QString::fromLocal8Bit(response.commandOutput))); @@ -896,16 +875,11 @@ void IosSimulatorToolHandlerPrivate::launchAppOnSimulator() q->finished(q); } }; - - if (appPId != -1) { - Utils::FileName appBundle = Utils::FileName::fromString(bundlePath); - futureList << Utils::onResultReady(simCtl->launchApp(deviceId, - SimulatorControl::bundleIdentifier(appBundle), appPId), - onResponseAppLaunch); - } else { - errorMsg(IosToolHandler::tr("Spawning the Application process on Simulator failed. Spawning timed out.")); - didStartApp(bundlePath, deviceId, Ios::IosToolHandler::Failure); - } + Utils::FileName appBundle = Utils::FileName::fromString(bundlePath); + futureList << Utils::onResultReady(simCtl->launchApp(deviceId, + SimulatorControl::bundleIdentifier(appBundle), + runKind == IosToolHandler::DebugRun, + extraArgs), onResponseAppLaunch); } bool IosSimulatorToolHandlerPrivate::isResponseValid(const SimulatorControl::ResponseData &responseData) @@ -921,40 +895,6 @@ bool IosSimulatorToolHandlerPrivate::isResponseValid(const SimulatorControl::Res return true; } -void IosSimulatorToolHandlerPrivate::onResponseAppSpawn(const SimulatorControl::ResponseData &response) -{ - if (!isResponseValid(response)) - return; - - if (response.processInstance) { - QTC_ASSERT(!process || !isRunning(), - qCDebug(toolHandlerLog) << "Spwaning app while an app instance exits."); - process = response.processInstance; - QObject::connect(process.get(), &QProcess::readyReadStandardOutput, - std::bind(&IosSimulatorToolHandlerPrivate::simAppProcessHasData, this)); - QObject::connect(process.get(), &QProcess::readyReadStandardError, - std::bind(&IosSimulatorToolHandlerPrivate::simAppProcessHasErrorOutput, this)); - QObject::connect(process.get(), static_cast(&QProcess::finished), - std::bind(&IosSimulatorToolHandlerPrivate::simAppProcessFinished, this, _1, _2)); - QObject::connect(process.get(), &QProcess::errorOccurred, - std::bind(&IosSimulatorToolHandlerPrivate::simAppProcessError, this, _1)); - - appPId = response.pID; - gotInferiorPid(bundlePath, deviceId, appPId); - - // For normal run. Launch app on Simulator. - // For debug run, wait for the debugger to attach and then launch the app. - if (runKind == IosToolHandler::NormalRun) - launchAppOnSimulator(); - } else { - errorMsg(IosToolHandler::tr("Spawning the Application process on Simulator failed. %1") - .arg(QString::fromLocal8Bit(response.commandOutput))); - didStartApp(bundlePath, deviceId, Ios::IosToolHandler::Failure); - stop(-1); - q->finished(q); - } -} - void IosSimulatorToolHandlerPrivate::simAppProcessError(QProcess::ProcessError error) { errorMsg(IosToolHandler::tr("Simulator application process error %1").arg(error)); @@ -1010,11 +950,6 @@ void IosToolHandler::stop() d->stop(-1); } -void IosToolHandler::debuggerStateChanged(int state) -{ - d->debuggerStateChanged((Debugger::DebuggerState)state); -} - void IosToolHandler::requestTransferApp(const QString &bundlePath, const QString &deviceId, int timeout) { diff --git a/src/plugins/ios/iostoolhandler.h b/src/plugins/ios/iostoolhandler.h index df1cd089cf8..d2243a932ec 100644 --- a/src/plugins/ios/iostoolhandler.h +++ b/src/plugins/ios/iostoolhandler.h @@ -64,7 +64,6 @@ public: void requestDeviceInfo(const QString &deviceId, int timeout = 1000); bool isRunning(); void stop(); - void debuggerStateChanged(int state); signals: void isTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath, diff --git a/src/plugins/ios/simulatorcontrol.cpp b/src/plugins/ios/simulatorcontrol.cpp index e3436d9fb01..005ef882b59 100644 --- a/src/plugins/ios/simulatorcontrol.cpp +++ b/src/plugins/ios/simulatorcontrol.cpp @@ -42,13 +42,7 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include using namespace std; @@ -63,7 +57,7 @@ static int COMMAND_TIMEOUT = 10000; static int SIMULATOR_START_TIMEOUT = 60000; static QString SIM_UDID_TAG = QStringLiteral("SimUdid"); -static bool checkForTimeout(const chrono::time_point< chrono::high_resolution_clock, chrono::nanoseconds> &start, int msecs = COMMAND_TIMEOUT) +static bool checkForTimeout(const chrono::high_resolution_clock::time_point &start, int msecs = COMMAND_TIMEOUT) { bool timedOut = false; auto end = chrono::high_resolution_clock::now(); @@ -75,6 +69,7 @@ static bool checkForTimeout(const chrono::time_point< chrono::high_resolution_cl static bool runCommand(QString command, const QStringList &args, QByteArray *output) { Utils::SynchronousProcess p; + p.setTimeoutS(-1); Utils::SynchronousProcessResponse resp = p.runBlocking(command, args); if (output) *output = resp.allRawOutput(); @@ -89,31 +84,6 @@ static QByteArray runSimCtlCommand(QStringList args) return output; } -static bool waitForProcessSpawn(qint64 processPId, QFutureInterface &fi) -{ - bool success = false; - if (processPId != -1) { - // Wait for app to reach intruptible sleep state. - const QStringList args = {QStringLiteral("-p"), QString::number(processPId), - QStringLiteral("-o"), QStringLiteral("wq=")}; - int wqCount = -1; - QByteArray wqStr; - auto begin = chrono::high_resolution_clock::now(); - do { - if (fi.isCanceled() || !runCommand(QStringLiteral("ps"), args, &wqStr)) - break; - bool validInt = false; - wqCount = wqStr.trimmed().toInt(&validInt); - if (!validInt) - wqCount = -1; - } while (wqCount < 0 && !checkForTimeout(begin)); - success = wqCount >= 0; - } else { - qCDebug(simulatorLog) << "Wait for spawned failed. Invalid Process ID." << processPId; - } - return success; -} - class SimulatorControlPrivate { private: struct SimDeviceInfo { @@ -136,11 +106,9 @@ private: void startSimulator(QFutureInterface &fi, const QString &simUdid); void installApp(QFutureInterface &fi, const QString &simUdid, const Utils::FileName &bundlePath); - void spawnAppProcess(QFutureInterface &fi, const QString &simUdid, - const Utils::FileName &bundlePath, bool waitForDebugger, QStringList extraArgs, - QThread *mainThread); void launchApp(QFutureInterface &fi, const QString &simUdid, - const QString &bundleIdentifier, qint64 spawnedPID); + const QString &bundleIdentifier, bool waitForDebugger, + const QStringList &extraArgs); static QList availableDevices; friend class SimulatorControl; @@ -215,7 +183,7 @@ QString SimulatorControl::bundleExecutable(const Utils::FileName &bundlePath) return SimulatorControlPrivate::bundleExecutable(bundlePath); } -QFuture SimulatorControl::startSimulator(const QString &simUdid) +QFuture SimulatorControl::startSimulator(const QString &simUdid) const { return Utils::runAsync(&SimulatorControlPrivate::startSimulator, d, simUdid); } @@ -226,20 +194,12 @@ SimulatorControl::installApp(const QString &simUdid, const Utils::FileName &bund return Utils::runAsync(&SimulatorControlPrivate::installApp, d, simUdid, bundlePath); } -QFuture -SimulatorControl::spawnAppProcess(const QString &simUdid, const Utils::FileName &bundlePath, - bool waitForDebugger, const QStringList &extraArgs) const -{ - return Utils::runAsync(&SimulatorControlPrivate::spawnAppProcess, d, simUdid, bundlePath, - waitForDebugger, extraArgs, QThread::currentThread()); -} - QFuture SimulatorControl::launchApp(const QString &simUdid, const QString &bundleIdentifier, - qint64 spawnedPID) const + bool waitForDebugger, const QStringList &extraArgs) const { - return Utils::runAsync(&SimulatorControlPrivate::launchApp, d, simUdid, - bundleIdentifier, spawnedPID); + return Utils::runAsync(&SimulatorControlPrivate::launchApp, d, simUdid, bundleIdentifier, + waitForDebugger, extraArgs); } QList SimulatorControlPrivate::availableDevices; @@ -362,7 +322,6 @@ void SimulatorControlPrivate::startSimulator(QFutureInterface &fi, - const QString &simUdid, const Utils::FileName &bundlePath, - bool waitForDebugger, QStringList extraArgs, QThread *mainThread) -{ - SimulatorControl::ResponseData response(simUdid); - - // Find the path of the installed app. - QString bundleId = bundleIdentifier(bundlePath); - QByteArray appContainer = runSimCtlCommand({QStringLiteral("get_app_container"), simUdid, bundleId}); - QString appPath = QString::fromLocal8Bit(appContainer.trimmed()); - - if (fi.isCanceled()) - return; - - QString executableName = bundleExecutable(bundlePath); - if (!appPath.isEmpty() && !executableName.isEmpty()) { - appPath.append('/' + executableName); - QStringList args = {QStringLiteral("simctl"), QStringLiteral("spawn"), simUdid, appPath}; - if (waitForDebugger) - args.insert(2, QStringLiteral("-w")); - args << extraArgs; - - // Spawn the app. The spawned app is started in suspended mode. - shared_ptr simCtlProcess(new QProcess, [](QProcess *p) { - if (p->state() != QProcess::NotRunning) { - p->kill(); - p->waitForFinished(COMMAND_TIMEOUT); - } - delete p; - }); - simCtlProcess->start(QStringLiteral("xcrun"), args); - if (simCtlProcess->waitForStarted()) { - if (fi.isCanceled()) - return; - // Find the process id of the spawned app. - qint64 simctlPId = simCtlProcess->processId(); - QByteArray commandOutput; - const QStringList pGrepArgs = {QStringLiteral("-f"), appPath}; - auto begin = chrono::high_resolution_clock::now(); - int processID = -1; - while (processID == -1 && runCommand(QStringLiteral("pgrep"), pGrepArgs, &commandOutput)) { - if (fi.isCanceled()) { - qCDebug(simulatorLog) <<"Spawning the app failed. Future cancelled."; - return; - } - foreach (auto pidStr, commandOutput.trimmed().split('\n')) { - qint64 parsedPId = pidStr.toLongLong(); - if (parsedPId != simctlPId) - processID = parsedPId; - } - if (checkForTimeout(begin)) { - qCDebug(simulatorLog) << "Spawning the app failed. Process timed out"; - break; - } - } - - if (processID == -1) { - qCDebug(simulatorLog) << "Spawning the app failed. App PID not found."; - simCtlProcess->waitForReadyRead(COMMAND_TIMEOUT); - response.commandOutput = simCtlProcess->readAllStandardError(); - } else { - response.processInstance = simCtlProcess; - response.processInstance->moveToThread(mainThread); - response.pID = processID; - response.success = true; - } - } else { - qCDebug(simulatorLog) << "Spawning the app failed." << simCtlProcess->errorString(); - response.commandOutput = simCtlProcess->errorString().toLatin1(); - } - } else { - qCDebug(simulatorLog) << "Spawning the app failed. Check installed app." << appPath; - } - - if (!fi.isCanceled()) { - QThread::msleep(500); // give it some time. TODO: find an actual fix. fi.reportResult(response); } } void SimulatorControlPrivate::launchApp(QFutureInterface &fi, const QString &simUdid, const QString &bundleIdentifier, - qint64 spawnedPID) + bool waitForDebugger, const QStringList &extraArgs) { SimulatorControl::ResponseData response(simUdid); - if (!bundleIdentifier.isEmpty()) { - bool processSpawned = true; - // Wait for the process to be spawned properly before launching app. - if (spawnedPID > -1) - processSpawned = waitForProcessSpawn(spawnedPID, fi); + if (!bundleIdentifier.isEmpty() && !fi.isCanceled()) { + QStringList args({QStringLiteral("launch"), simUdid, bundleIdentifier}); - if (fi.isCanceled()) - return; + if (waitForDebugger) + args.insert(1, QStringLiteral("-w")); - if (processSpawned) { - QThread::msleep(500); // give it some time. TODO: find an actual fix. - const QStringList args({QStringLiteral("launch"), simUdid , bundleIdentifier}); - response.commandOutput = runSimCtlCommand(args); - const QByteArray pIdStr = response.commandOutput.trimmed().split(' ').last().trimmed(); - bool validInt = false; - response.pID = pIdStr.toLongLong(&validInt); - if (!validInt) { - // Launch Failed. - qCDebug(simulatorLog) << "Launch app failed. Process id returned is not valid. PID =" << pIdStr; - response.pID = -1; - } + foreach (const QString extraArgument, extraArgs) { + if (!extraArgument.trimmed().isEmpty()) + args << extraArgument; } + + response.commandOutput = runSimCtlCommand(args); + const QByteArray pIdStr = response.commandOutput.trimmed().split(' ').last().trimmed(); + bool validPid = false; + response.pID = pIdStr.toLongLong(&validPid); + response.success = validPid; } if (!fi.isCanceled()) { diff --git a/src/plugins/ios/simulatorcontrol.h b/src/plugins/ios/simulatorcontrol.h index 2c3b2cd296e..5082a437dad 100644 --- a/src/plugins/ios/simulatorcontrol.h +++ b/src/plugins/ios/simulatorcontrol.h @@ -52,9 +52,6 @@ public: bool success = false; qint64 pID = -1; QByteArray commandOutput = ""; - // For response type APP_SPAWN, the processInstance represents the control process of the spwaned app - // For other response types its null. - std::shared_ptr processInstance; }; public: @@ -69,12 +66,10 @@ public: static QString bundleExecutable(const Utils::FileName &bundlePath); public: - QFuture startSimulator(const QString &simUdid); + QFuture startSimulator(const QString &simUdid) const; QFuture installApp(const QString &simUdid, const Utils::FileName &bundlePath) const; - QFuture spawnAppProcess(const QString &simUdid, const Utils::FileName &bundlePath, - bool waitForDebugger, const QStringList &extraArgs) const; QFuture launchApp(const QString &simUdid, const QString &bundleIdentifier, - qint64 spawnedPID = -1) const; + bool waitForDebugger, const QStringList &extraArgs) const; private: SimulatorControlPrivate *d; diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 448f8cfe3f1..993bd2fd7b5 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -164,7 +164,9 @@ static QList parseCoffHeader(const QByteArray &data) flavor = Abi::WindowsMsvc2013Flavor; break; case 14: - flavor = Abi::WindowsMsvc2015Flavor; + flavor = minorLinker >= quint8(10) + ? Abi::WindowsMsvc2017Flavor // MSVC2017 RC + : Abi::WindowsMsvc2015Flavor; break; case 15: flavor = Abi::WindowsMsvc2017Flavor; diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 515fd6caafb..4fc619d1f42 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -291,6 +291,15 @@ void Kit::setup() info.at(i)->setup(this); } +void Kit::upgrade() +{ + KitGuard g(this); + // Process the KitInfos in reverse order: They may only be based on other information lower in + // the stack. + for (KitInformation *ki : KitManager::kitInformation()) + ki->upgrade(this); +} + QString Kit::unexpandedDisplayName() const { return d->m_unexpandedDisplayName; diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index 13f92bce474..20b9739e69a 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -69,6 +69,7 @@ public: void fix(); // Fix the individual kit information: Make sure it contains a valid value. // Fix will not look at other information in the kit! void setup(); // Apply advanced magic(TM). Used only once on each kit during initial setup. + void upgrade(); // Upgrade settings to new syntax (if appropriate). QString unexpandedDisplayName() const; QString displayName() const; diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index c2d83e974d7..90a9c9445ae 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -197,7 +197,9 @@ QList ToolChainKitInformation::validate(const Kit *k) const void ToolChainKitInformation::upgrade(Kit *k) { // upgrade <=4.1 to 4.2 (keep old settings around for now) - const QVariant oldValue = k->value("PE.Profile.ToolChain"); + const Core::Id oldId = "PE.Profile.ToolChain"; + const QVariant oldValue = k->value(oldId); + const QVariant value = k->value(ToolChainKitInformation::id()); if (value.isNull() && !oldValue.isNull()) { QVariantMap newValue; @@ -216,6 +218,7 @@ void ToolChainKitInformation::upgrade(Kit *k) } } k->setValue(ToolChainKitInformation::id(), newValue); + k->setSticky(ToolChainKitInformation::id(), k->isSticky(oldId)); } } @@ -224,8 +227,9 @@ void ToolChainKitInformation::fix(Kit *k) QTC_ASSERT(ToolChainManager::isLoaded(), return); foreach (ToolChain::Language l, ToolChain::allLanguages()) { if (!toolChain(k, l)) { - qWarning("No tool chain set from kit \"%s\".", - qPrintable(k->displayName())); + qWarning("No tool chain set up in kit \"%s\" for \"%s\".", + qPrintable(k->displayName()), + qPrintable(ToolChain::languageDisplayName(l))); clearToolChain(k, l); // make sure to clear out no longer known tool chains } } diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 8d5e6efb335..85d7d506533 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -165,6 +165,7 @@ void KitManager::restoreKits() Kit *toStore = 0; foreach (Kit *current, kitsToValidate) { toStore = current; + toStore->upgrade(); toStore->setup(); // Make sure all kitinformation are properly set up before merging them // with the information from the user settings file diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 0b5ce6d1c12..89bb848464b 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -218,9 +218,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor data.insert(QLatin1String(QBS_ARCHITECTURE), qbs::canonicalArchitecture(architecture)); } - QStringList targetOS = targetOSList(targetAbi, k); - if (!targetOS.isEmpty()) - data.insert(QLatin1String(QBS_TARGETOS), targetOS); + data.insert(QLatin1String(QBS_TARGETOS), targetOSList(targetAbi, k)); QStringList toolchain = toolchainList(mainTc); diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index a97ecc68add..70e68e77041 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -72,16 +72,21 @@ void QmakeKitInformation::setup(Kit *k) if (!version) return; + if (version->type() == "Boot2Qt.QtVersionType") // HACK: Ignore boot2Qt kits! + return; + FileName spec = QmakeKitInformation::mkspec(k); if (spec.isEmpty()) spec = version->mkspec(); + ToolChain *tc = ToolChainKitInformation::toolChain(k, ToolChain::Language::Cxx); if (!tc || (!tc->suggestedMkspecList().empty() && !tc->suggestedMkspecList().contains(spec))) { - ToolChain *possibleTc = 0; + ToolChain *possibleTc = nullptr; foreach (ToolChain *current, ToolChainManager::toolChains()) { - if (version->qtAbis().contains(current->targetAbi())) { + if (current->language() == ToolChain::Language::Cxx + && version->qtAbis().contains(current->targetAbi())) { possibleTc = current; if (current->suggestedMkspecList().contains(spec)) break; diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index f81a6949746..7c97296c495 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -231,6 +231,7 @@ void BindlingLoopsGeometry::allocate(QSGMaterial *material) { QSGGeometry *geometry = new QSGGeometry(BindlingLoopsGeometry::point2DWithOffset(), usedVertices); + Q_ASSERT(geometry->vertexData()); geometry->setIndexDataPattern(QSGGeometry::StaticPattern); geometry->setVertexDataPattern(QSGGeometry::StaticPattern); node = new QSGGeometryNode; diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp index be9ffd91599..582ccb09306 100644 --- a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp +++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp @@ -44,7 +44,8 @@ namespace TextEditor { Keywords::Keywords(const QStringList &variables, const QStringList &functions, const QMap &functionArgs) : m_variables(variables), m_functions(functions), m_functionArgs(functionArgs) { - + Utils::sort(m_variables); + Utils::sort(m_functions); } bool Keywords::isVariable(const QString &word) const diff --git a/src/plugins/valgrind/unit_testdata/memcheck-output-sample1.xml b/src/plugins/valgrind/unit_testdata/memcheck-output-sample1.xml new file mode 100644 index 00000000000..e4278497c9d --- /dev/null +++ b/src/plugins/valgrind/unit_testdata/memcheck-output-sample1.xml @@ -0,0 +1,370 @@ + + + + +4 +memcheck + + + Memcheck, a memory error detector + Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. + Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info + Command: kate + + +22733 +17584 +memcheck + + + + /usr/bin/valgrind.bin + --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp + --xml=yes + --xml-file=test.xml + --track-origins=yes + + + kate + + + + + RUNNING + + + + + 0x9 + 1 + InvalidRead + Invalid read of size 4 + + + 0x6E47964 + /usr/lib/libQtGui.so.4.7.0 + QFrame::frameStyle() const + /build/buildd/qt4-x11-4.7.0/src/gui/widgets + qframe.cpp + 252 + + + 0x118F2AF7 + /usr/lib/kde4/plugins/styles/oxygen.so + + + 0x6A81671 + /usr/lib/libQtGui.so.4.7.0 + QWidget::event(QEvent*) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qwidget.cpp + 8273 + + + 0x6A2B6EB + /usr/lib/libQtGui.so.4.7.0 + QApplicationPrivate::notify_helper(QObject*, QEvent*) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qapplication.cpp + 4396 + + + + Address 0x11527cb8 is not stack'd, malloc'd or (recently) free'd + + + + + FINISHED + + + + + 0x13 + 1 + Leak_PossiblyLost + + 2 bytes in 1 blocks are possibly lost in loss record 2 of 2,003 + 2 + 1 + + + + 0x4C284A8 + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so + malloc + /build/buildd/valgrind-3.6.0~svn20100212/coregrind/m_replacemalloc + vg_replace_malloc.c + 236 + + + 0xD4D7754 + /lib/libglib-2.0.so.0.2400.1 + g_malloc + + + 0xD4EF11D + /lib/libglib-2.0.so.0.2400.1 + g_strdup + + + 0xD503DC4 + /lib/libglib-2.0.so.0.2400.1 + g_get_language_names + + + 0xD4F89A9 + /lib/libglib-2.0.so.0.2400.1 + g_thread_init_glib + + + 0x8396569 + /usr/lib/libQtCore.so.4.7.0 + QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) + /build/buildd/qt4-x11-4.7.0/src/corelib/kernel + qeventdispatcher_glib.cpp + 299 + + + 0x6ADDBEE + /usr/lib/libQtGui.so.4.7.0 + QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qguieventdispatcher_glib.cpp + 171 + + + 0x6ADDCDD + /usr/lib/libQtGui.so.4.7.0 + QGuiEventDispatcherGlib::QGuiEventDispatcherGlib(QObject*) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qguieventdispatcher_glib.cpp + 186 + + + 0x6AA5152 + /usr/lib/libQtGui.so.4.7.0 + QApplicationPrivate::createEventDispatcher() + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qapplication_x11.cpp + 605 + + + 0x836D069 + /usr/lib/libQtCore.so.4.7.0 + QCoreApplication::init() + /build/buildd/qt4-x11-4.7.0/src/corelib/kernel + qcoreapplication.cpp + 552 + + + 0x836D134 + /usr/lib/libQtCore.so.4.7.0 + QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) + /build/buildd/qt4-x11-4.7.0/src/corelib/kernel + qcoreapplication.cpp + 477 + + + 0x6A3815A + /usr/lib/libQtGui.so.4.7.0 + QApplication::QApplication(int&, char**, bool, int) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qapplication.cpp + 745 + + + + + + 0x7e4 + 1 + Leak_DefinitelyLost + + 544,542 (56 direct, 544,486 indirect) bytes in 1 blocks are definitely lost in loss record 2,003 of 2,003 + 544542 + 1 + + + + 0x4C284A8 + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so + malloc + /build/buildd/valgrind-3.6.0~svn20100212/coregrind/m_replacemalloc + vg_replace_malloc.c + 236 + + + 0x82A1A6C + /usr/lib/libQtCore.so.4.7.0 + QMapData::node_create(QMapData::Node**, int, int) + /build/buildd/qt4-x11-4.7.0/src/corelib/tools + qmap.cpp + 140 + + + 0x8336F68 + /usr/lib/libQtCore.so.4.7.0 + QMap<QSettingsKey, QVariant>::detach_helper() + /build/buildd/qt4-x11-4.7.0/src/corelib/../../include/QtCore/../../src/corelib/tools + qmap.h + 449 + + + 0x832C564 + /usr/lib/libQtCore.so.4.7.0 + QConfFile::mergedKeyMap() const + /build/buildd/qt4-x11-4.7.0/src/corelib/../../include/QtCore/../../src/corelib/tools + qmap.h + 202 + + + 0x833305A + /usr/lib/libQtCore.so.4.7.0 + QConfFileSettingsPrivate::syncConfFile(int) + /build/buildd/qt4-x11-4.7.0/src/corelib/io + qsettings.cpp + 1569 + + + 0x8333D5B + /usr/lib/libQtCore.so.4.7.0 + QConfFileSettingsPrivate::sync() + /build/buildd/qt4-x11-4.7.0/src/corelib/io + qsettings.cpp + 1386 + + + 0x83260D9 + /usr/lib/libQtCore.so.4.7.0 + QSettingsPrivate::update() + /build/buildd/qt4-x11-4.7.0/src/corelib/io + qsettings.cpp + 415 + + + 0x83267C7 + /usr/lib/libQtCore.so.4.7.0 + QSettings::event(QEvent*) + /build/buildd/qt4-x11-4.7.0/src/corelib/io + qsettings.cpp + 3326 + + + 0x6A2B6EB + /usr/lib/libQtGui.so.4.7.0 + QApplicationPrivate::notify_helper(QObject*, QEvent*) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qapplication.cpp + 4396 + + + 0x6A311DC + /usr/lib/libQtGui.so.4.7.0 + QApplication::notify(QObject*, QEvent*) + /build/buildd/qt4-x11-4.7.0/src/gui/kernel + qapplication.cpp + 4277 + + + 0x6443535 + /usr/lib/libkdeui.so.5.5.0 + KApplication::notify(QObject*, QEvent*) + + + 0x83690AB + /usr/lib/libQtCore.so.4.7.0 + QCoreApplication::notifyInternal(QObject*, QEvent*) + /build/buildd/qt4-x11-4.7.0/src/corelib/kernel + qcoreapplication.cpp + 732 + + + + + + + 2 + 0x9 + + + + + + 12 + X on SUSE11 writev uninit padding + + + 2 + dl-hack3-cond-1 + + + 2 + glibc-2.5.x-on-SUSE-10.2-(PPC)-2a + + + + + diff --git a/src/plugins/valgrind/valgrind.pro b/src/plugins/valgrind/valgrind.pro index e7c82174fe4..504a9123cc2 100644 --- a/src/plugins/valgrind/valgrind.pro +++ b/src/plugins/valgrind/valgrind.pro @@ -55,3 +55,16 @@ FORMS += \ RESOURCES += \ valgrind.qrc + +equals(TEST, 1) { + DEFINES += "PARSERTESTS_DATA_DIR=\\\"$$_PRO_FILE_PWD_/unit_testdata\\\"" + DEFINES += "VALGRIND_FAKE_PATH=\\\"$$IDE_BUILD_TREE/src/tools/valgrindfake\\\"" + DEFINES += "TESTRUNNER_SRC_DIR=\\\"$$_PRO_FILE_PWD_/../../../tests/auto/valgrind/memcheck/testapps\\\"" + DEFINES += "TESTRUNNER_APP_DIR=\\\"$(PWD)/../../../tests/auto/valgrind/memcheck/testapps\\\"" + + HEADERS += valgrindmemcheckparsertest.h \ + valgrindtestrunnertest.h + + SOURCES += valgrindmemcheckparsertest.cpp \ + valgrindtestrunnertest.cpp +} diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index beaf1bb830e..f82ba7c223a 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -1,4 +1,5 @@ -import qbs 1.0 +import qbs +import qbs.FileInfo QtcPlugin { name: "Valgrind" @@ -88,4 +89,21 @@ QtcPlugin { "threadedparser.cpp", "threadedparser.h", ] } + + Group { + name: "Test sources" + condition: qtc.testsEnabled + files: [ + "valgrindmemcheckparsertest.cpp", + "valgrindmemcheckparsertest.h", + "valgrindtestrunnertest.cpp", + "valgrindtestrunnertest.h", + ] + cpp.defines: outer.concat([ + 'PARSERTESTS_DATA_DIR="' + FileInfo.joinPaths(path, "unit_testdata") + '"', + 'VALGRIND_FAKE_PATH="' + FileInfo.joinPaths(project.buildDirectory, qtc.ide_bin_path) + '"', + 'TESTRUNNER_SRC_DIR="' + FileInfo.joinPaths(path, "../../../tests/auto/valgrind/memcheck/testapps") + '"', + 'TESTRUNNER_APP_DIR="' + FileInfo.joinPaths(project.buildDirectory, qtc.ide_bin_path, "testapps") + '"' + ]) + } } diff --git a/tests/auto/valgrind/memcheck/parsertests.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp similarity index 85% rename from tests/auto/valgrind/memcheck/parsertests.cpp rename to src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 4d700e599be..4c9fa218f4d 100644 --- a/tests/auto/valgrind/memcheck/parsertests.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -24,31 +24,26 @@ ** ****************************************************************************/ -#include -#include -#include -#include +#include "valgrindmemcheckparsertest.h" +#include "xmlprotocol/frame.h" +#include "xmlprotocol/parser.h" +#include "xmlprotocol/stack.h" +#include "xmlprotocol/suppression.h" + +#include #include #include -#include -#include "parsertests.h" - -#include -#include #include #include +#include #include #include #include #include #include -#include -#include - -using namespace Valgrind; using namespace Valgrind::XmlProtocol; QT_BEGIN_NAMESPACE @@ -64,7 +59,10 @@ inline bool qCompare(int const &t1, MemcheckErrorKind const &t2, } // namespace QTest QT_END_NAMESPACE -void dumpFrame(const Frame &f) +namespace Valgrind { +namespace Test { + +static void dumpFrame(const Frame &f) { qDebug() << f.instructionPointer() << f.directory() << f.fileName() << f.functionName() << f.line() << f.object(); @@ -74,10 +72,10 @@ void dumpError(const Error &e) { qDebug() << e.kind() << e.leakedBlocks() << e.leakedBytes() << e.what() << e.tid() << e.unique(); qDebug() << "stacks:" << e.stacks().size(); - Q_FOREACH(const Stack& s, e.stacks()) { + for (const Stack &s : e.stacks()) { qDebug() << s.auxWhat() << s.directory() << s.file() << s.line() << s.helgrindThreadId(); qDebug() << "frames:"; - Q_FOREACH(const Frame& f, s.frames()) { + for (const Frame &f : s.frames()) { dumpFrame(f); } } @@ -85,7 +83,21 @@ void dumpError(const Error &e) static QString fakeValgrindExecutable() { - return QLatin1String(VALGRIND_FAKE_PATH); + QString valgrindFakePath(VALGRIND_FAKE_PATH); + if (Utils::HostOsInfo::isWindowsHost()) { + QFileInfo fi(QString(valgrindFakePath + "/debug"), "valgrind-fake.exe"); + if (fi.exists()) + return fi.canonicalFilePath(); + fi = QFileInfo(QString(valgrindFakePath + "/release"), "valgrind-fake.exe"); + if (fi.exists()) + return fi.canonicalFilePath(); + // Qbs uses the install-root/bin + fi = QFileInfo(valgrindFakePath, "valgrind-fake.exe"); + if (fi.exists()) + return fi.canonicalFilePath(); + qFatal("Neither debug nor release build valgrind-fake found."); + } + return valgrindFakePath + "/valgrind-fake"; } static QString dataFile(const QLatin1String &file) @@ -93,10 +105,8 @@ static QString dataFile(const QLatin1String &file) return QLatin1String(PARSERTESTS_DATA_DIR) + QLatin1String("/") + file; } -void ParserTests::initTestCase() +void ValgrindMemcheckParserTest::initTestCase() { - new ExtensionSystem::PluginManager; - new ProjectExplorer::ProjectExplorerPlugin; m_server = new QTcpServer(this); QVERIFY(m_server->listen()); @@ -104,7 +114,7 @@ void ParserTests::initTestCase() m_process = 0; } -void ParserTests::initTest(const QLatin1String &testfile, const QStringList &otherArgs) +void ValgrindMemcheckParserTest::initTest(const QLatin1String &testfile, const QStringList &otherArgs) { QVERIFY(!m_server->hasPendingConnections()); @@ -132,7 +142,7 @@ void ParserTests::initTest(const QLatin1String &testfile, const QStringList &oth QVERIFY(m_socket); } -void ParserTests::cleanup() +void ValgrindMemcheckParserTest::cleanup() { if (m_socket) { delete m_socket; @@ -144,7 +154,7 @@ void ParserTests::cleanup() } } -void ParserTests::testHelgrindSample1() +void ValgrindMemcheckParserTest::testHelgrindSample1() { QSKIP("testfile does not exist"); @@ -240,7 +250,7 @@ void ParserTests::testHelgrindSample1() // QCOMPARE(rec.suppcounts, expectedSuppCounts); } -void ParserTests::testMemcheckSample1() +void ValgrindMemcheckParserTest::testMemcheckSample1() { initTest(QLatin1String("memcheck-output-sample1.xml")); @@ -316,7 +326,7 @@ void ParserTests::testMemcheckSample1() QCOMPARE(rec.suppcounts, expectedSuppCounts); } -void ParserTests::testMemcheckSample2() +void ValgrindMemcheckParserTest::testMemcheckSample2() { QSKIP("testfile does not exist"); @@ -342,7 +352,7 @@ void ParserTests::testMemcheckSample2() QCOMPARE(stacks.last().auxWhat(), QLatin1String("Address 0x11b66c50 is 0 bytes inside a block of size 16 free'd")); } -void ParserTests::testMemcheckSample3() +void ValgrindMemcheckParserTest::testMemcheckSample3() { QSKIP("testfile does not exist"); @@ -394,7 +404,7 @@ void ParserTests::testMemcheckSample3() QCOMPARE(rec.suppcounts.at(2).second, qint64(3)); } -void ParserTests::testMemcheckCharm() +void ValgrindMemcheckParserTest::testMemcheckCharm() { QSKIP("testfile does not exist"); @@ -415,7 +425,7 @@ void ParserTests::testMemcheckCharm() QVERIFY2(parser.errorString().isEmpty(), qPrintable(parser.errorString())); } -void ParserTests::testValgrindCrash() +void ValgrindMemcheckParserTest::testValgrindCrash() { initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--crash"); @@ -430,7 +440,7 @@ void ParserTests::testValgrindCrash() QCOMPARE(parser.errorString(), m_socket->errorString()); } -void ParserTests::testValgrindGarbage() +void ValgrindMemcheckParserTest::testValgrindGarbage() { initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--garbage"); @@ -444,7 +454,7 @@ void ParserTests::testValgrindGarbage() qDebug() << parser.errorString(); } -void ParserTests::testParserStop() +void ValgrindMemcheckParserTest::testParserStop() { ThreadedParser parser; Memcheck::MemcheckRunner runner; @@ -455,31 +465,39 @@ void ParserTests::testParserStop() << "--wait" << "5"); runner.setProcessChannelMode(QProcess::ForwardedChannels); + runner.setDevice(ProjectExplorer::DeviceManager::instance()->defaultDevice( + Core::Id(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE))); runner.start(); QTest::qWait(500); runner.stop(); } -void ParserTests::testRealValgrind() +void ValgrindMemcheckParserTest::testRealValgrind() { + const Utils::Environment &sysEnv = Utils::Environment::systemEnvironment(); + auto fileName = sysEnv.searchInPath("valgrind"); + if (fileName.isEmpty()) + QSKIP("This test needs valgrind in PATH"); QString executable = QProcessEnvironment::systemEnvironment().value("VALGRIND_TEST_BIN", fakeValgrindExecutable()); qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this"; ThreadedParser parser; ProjectExplorer::StandardRunnable debuggee; debuggee.executable = executable; - + debuggee.environment = sysEnv; Memcheck::MemcheckRunner runner; runner.setValgrindExecutable(QLatin1String("valgrind")); runner.setDebuggee(debuggee); + runner.setDevice(ProjectExplorer::DeviceManager::instance()->defaultDevice( + Core::Id(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE))); runner.setParser(&parser); RunnerDumper dumper(&runner, &parser); runner.start(); runner.waitForFinished(); } -void ParserTests::testValgrindStartError_data() +void ValgrindMemcheckParserTest::testValgrindStartError_data() { QTest::addColumn("valgrindExe"); QTest::addColumn("valgrindArgs"); @@ -497,24 +515,27 @@ void ParserTests::testValgrindStartError_data() << fakeValgrindExecutable() << QString(); } -void ParserTests::testValgrindStartError() +void ValgrindMemcheckParserTest::testValgrindStartError() { QFETCH(QString, valgrindExe); QFETCH(QStringList, valgrindArgs); - QFETCH(QString, debuggeeExecutable); + QFETCH(QString, debuggee); QFETCH(QString, debuggeeArgs); ThreadedParser parser; - ProjectExplorer::StandardRunnable debuggee; - debuggee.executable = debuggeeExecutable; - debuggee.commandLineArguments = debuggeeArgs; + ProjectExplorer::StandardRunnable debuggeeExecutable; + debuggeeExecutable.executable = debuggee; + debuggeeExecutable.environment = Utils::Environment::systemEnvironment(); + debuggeeExecutable.commandLineArguments = debuggeeArgs; Memcheck::MemcheckRunner runner; runner.setParser(&parser); runner.setValgrindExecutable(valgrindExe); runner.setValgrindArguments(valgrindArgs); - runner.setDebuggee(debuggee); + runner.setDebuggee(debuggeeExecutable); + runner.setDevice(ProjectExplorer::DeviceManager::instance()->defaultDevice( + Core::Id(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE))); RunnerDumper dumper(&runner, &parser); runner.start(); runner.waitForFinished(); @@ -522,4 +543,5 @@ void ParserTests::testValgrindStartError() // just finish without deadlock and we are fine } -QTEST_MAIN(ParserTests) +} // namespace Test +} // namespace Valgrind diff --git a/tests/auto/valgrind/memcheck/parsertests.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h similarity index 92% rename from tests/auto/valgrind/memcheck/parsertests.h rename to src/plugins/valgrind/valgrindmemcheckparsertest.h index cb65dd85577..f4c8f75676a 100644 --- a/tests/auto/valgrind/memcheck/parsertests.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -32,11 +32,11 @@ #include #include -#include -#include -#include -#include -#include +#include "xmlprotocol/error.h" +#include "xmlprotocol/status.h" +#include "xmlprotocol/threadedparser.h" +#include "xmlprotocol/parser.h" +#include "memcheck/memcheckrunner.h" QT_BEGIN_NAMESPACE class QTcpServer; @@ -44,6 +44,10 @@ class QTcpSocket; class QProcess; QT_END_NAMESPACE + +namespace Valgrind { +namespace Test { + void dumpError(const Valgrind::XmlProtocol::Error &e); class Recorder : public QObject @@ -134,7 +138,7 @@ public: }; -class ParserTests : public QObject +class ValgrindMemcheckParserTest : public QObject { Q_OBJECT @@ -159,7 +163,10 @@ private Q_SLOTS: private: void initTest(const QLatin1String &testfile, const QStringList &otherArgs = QStringList()); - QTcpServer *m_server; - QProcess *m_process; - QTcpSocket *m_socket; + QTcpServer *m_server = 0; + QProcess *m_process = 0; + QTcpSocket *m_socket = 0; }; + +} // namespace Test +} // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index 4ae0a361c85..ce58373512a 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -32,6 +32,11 @@ #include "valgrindsettings.h" #include "valgrindconfigwidget.h" +#ifdef WITH_TESTS +# include "valgrindmemcheckparsertest.h" +# include "valgrindtestrunnertest.h" +#endif + #include #include #include @@ -117,5 +122,14 @@ ValgrindGlobalSettings *ValgrindPlugin::globalSettings() return theGlobalSettings; } +QList ValgrindPlugin::createTestObjects() const +{ + QList tests; +#ifdef WITH_TESTS + tests << new Test::ValgrindMemcheckParserTest << new Test::ValgrindTestRunnerTest; +#endif + return tests; +} + } // namespace Internal } // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindplugin.h b/src/plugins/valgrind/valgrindplugin.h index b3f8cd2bd6e..e6a4fbd8eee 100644 --- a/src/plugins/valgrind/valgrindplugin.h +++ b/src/plugins/valgrind/valgrindplugin.h @@ -48,6 +48,8 @@ public: ShutdownFlag aboutToShutdown() override; static ValgrindGlobalSettings *globalSettings(); +private: + QList createTestObjects() const override; }; } // namespace Internal diff --git a/tests/auto/valgrind/memcheck/testrunner.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp similarity index 81% rename from tests/auto/valgrind/memcheck/testrunner.cpp rename to src/plugins/valgrind/valgrindtestrunnertest.cpp index 06bf1c05122..8e930bc3b6e 100644 --- a/tests/auto/valgrind/memcheck/testrunner.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -24,76 +24,78 @@ ** ****************************************************************************/ -#include "testrunner.h" +#include "valgrindtestrunnertest.h" -#include -#include -#include -#include -#include -#include +#include "xmlprotocol/frame.h" +#include "xmlprotocol/stack.h" +#include "xmlprotocol/suppression.h" +#include "xmlprotocol/threadedparser.h" +#include "xmlprotocol/parser.h" +#include "memcheck/memcheckrunner.h" +#include #include #include -#include #include #include #include #include -const QString appSrcDir(TESTRUNNER_SRC_DIR); -const QString appBinDir(TESTRUNNER_APP_DIR); +#define HEADER_LENGTH 25 -#define HEADER_LENGTH 30 +using namespace Valgrind::XmlProtocol; +using namespace Valgrind::Memcheck; -bool on64bit() +namespace Valgrind { +namespace Test { + +//BEGIN Test Helpers and boilerplate code + +static const QString appSrcDir(TESTRUNNER_SRC_DIR); +static const QString appBinDir(TESTRUNNER_APP_DIR); + +static bool on64bit() { return sizeof(char*) == 8; } -QString srcDirForApp(const QString &app) +static QString srcDirForApp(const QString &app) { - return appSrcDir + QLatin1Char('/') + app; + return QDir::cleanPath(appSrcDir + QLatin1Char('/') + app); } -QTEST_MAIN(Valgrind::TestRunner) - -using namespace Valgrind; -using namespace Valgrind::XmlProtocol; -using namespace Valgrind::Memcheck; - -//BEGIN Test Helpers and boilerplate code - -TestRunner::TestRunner(QObject *parent) - : QObject(parent), - m_parser(0), - m_runner(0) +ValgrindTestRunnerTest::ValgrindTestRunnerTest(QObject *parent) + : QObject(parent) { qRegisterMetaType(); } -QString TestRunner::runTestBinary(const QString &binary, const QStringList &vArgs) +QString ValgrindTestRunnerTest::runTestBinary(const QString &binary, const QStringList &vArgs) { - const QString binPath = appBinDir + QLatin1Char('/') + binary; - if (!QFileInfo(binPath).isExecutable()) - qFatal("No such test app: %s", qPrintable(binPath)); + const QFileInfo binPathFileInfo(appBinDir, binary); + if (!binPathFileInfo.isExecutable()) + return QString(); ProjectExplorer::StandardRunnable debuggee; + const QString &binPath = binPathFileInfo.canonicalFilePath(); debuggee.executable = binPath; + debuggee.environment = Utils::Environment::systemEnvironment(); m_runner->setValgrindArguments(QStringList() << "--num-callers=50" << "--track-origins=yes" << vArgs); m_runner->setDebuggee(debuggee); + m_runner->setDevice(ProjectExplorer::DeviceManager::instance()->defaultDevice( + Core::Id(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE))); m_runner->start(); m_runner->waitForFinished(); return binPath; } -void TestRunner::logMessageReceived(const QByteArray &message) +void ValgrindTestRunnerTest::logMessageReceived(const QByteArray &message) { qDebug() << "log message received:" << message; m_logMessages << message; } -void TestRunner::internalError(const QString &error) +void ValgrindTestRunnerTest::internalError(const QString &error) { if (!m_expectCrash) QFAIL(qPrintable(error)); @@ -101,12 +103,12 @@ void TestRunner::internalError(const QString &error) qDebug() << "expected crash:" << error; } -void TestRunner::error(const Error &error) +void ValgrindTestRunnerTest::error(const Error &error) { m_errors << error; } -void TestRunner::cleanup() +void ValgrindTestRunnerTest::cleanup() { Q_ASSERT(m_runner); delete m_runner; @@ -120,14 +122,12 @@ void TestRunner::cleanup() m_expectCrash = false; } -void TestRunner::initTestCase() -{ - new ExtensionSystem::PluginManager; - new ProjectExplorer::ProjectExplorerPlugin; -} - -void TestRunner::init() +void ValgrindTestRunnerTest::init() { + const Utils::Environment &sysEnv = Utils::Environment::systemEnvironment(); + auto fileName = sysEnv.searchInPath("valgrind"); + if (fileName.isEmpty()) + QSKIP("This test needs valgrind in PATH"); Q_ASSERT(m_logMessages.isEmpty()); Q_ASSERT(!m_runner); @@ -135,24 +135,27 @@ void TestRunner::init() m_runner->setValgrindExecutable(QLatin1String("valgrind")); m_runner->setProcessChannelMode(QProcess::ForwardedChannels); connect(m_runner, &MemcheckRunner::logMessageReceived, - this, &TestRunner::logMessageReceived); + this, &ValgrindTestRunnerTest::logMessageReceived); connect(m_runner, &ValgrindRunner::processErrorReceived, - this, &TestRunner::internalError); + this, &ValgrindTestRunnerTest::internalError); Q_ASSERT(!m_parser); m_parser = new ThreadedParser; connect(m_parser, &ThreadedParser::internalError, - this, &TestRunner::internalError); + this, &ValgrindTestRunnerTest::internalError); connect(m_parser, &ThreadedParser::error, - this, &TestRunner::error); + this, &ValgrindTestRunnerTest::error); m_runner->setParser(m_parser); } //BEGIN: Actual test cases -void TestRunner::testLeak1() +void ValgrindTestRunnerTest::testLeak1() { const QString binary = runTestBinary(QLatin1String("leak1/leak1")); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); QVERIFY(m_logMessages.isEmpty()); @@ -183,9 +186,12 @@ void TestRunner::testLeak1() } } -void TestRunner::testLeak2() +void ValgrindTestRunnerTest::testLeak2() { const QString binary = runTestBinary(QLatin1String("leak2/leak2")); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); QVERIFY(m_logMessages.isEmpty()); QCOMPARE(m_errors.count(), 1); @@ -220,10 +226,12 @@ void TestRunner::testLeak2() } } -void TestRunner::testLeak3() +void ValgrindTestRunnerTest::testLeak3() { const QString binary = runTestBinary(QLatin1String("leak3/leak3"), QStringList() << "--show-reachable=yes"); - + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); QVERIFY(m_logMessages.isEmpty()); QCOMPARE(m_errors.count(), 1); @@ -258,16 +266,19 @@ void TestRunner::testLeak3() } } -void TestRunner::testLeak4() +void ValgrindTestRunnerTest::testLeak4() { const QString app("leak4"); const QString binary = runTestBinary(app + QLatin1Char('/') + app, QStringList() << "--show-reachable=yes"); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp("leak4"); QVERIFY(m_logMessages.isEmpty()); - QCOMPARE(m_errors.count(), 2); + QCOMPARE(m_errors.count(), 3); //BEGIN first error { const Error error = m_errors.first(); @@ -306,7 +317,7 @@ void TestRunner::testLeak4() } //BEGIN second error { - const Error error = m_errors.last(); + const Error error = m_errors.at(1); QCOMPARE(error.kind(), int(Leak_DefinitelyLost)); QCOMPARE(error.leakedBlocks(), qint64(1)); if (on64bit()) @@ -334,12 +345,16 @@ void TestRunner::testLeak4() QCOMPARE(QDir::cleanPath(frame.directory()), srcDir); } } + // TODO add third error check } -void TestRunner::uninit1() +void ValgrindTestRunnerTest::testUninit1() { const QString app("uninit1"); const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -378,11 +393,14 @@ void TestRunner::uninit1() } } -void TestRunner::uninit2() +void ValgrindTestRunnerTest::testUninit2() { const QString app("uninit2"); m_expectCrash = true; const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -442,11 +460,14 @@ void TestRunner::uninit2() } } -void TestRunner::uninit3() +void ValgrindTestRunnerTest::testUninit3() { const QString app("uninit3"); m_expectCrash = true; const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -506,10 +527,13 @@ void TestRunner::uninit3() } } -void TestRunner::syscall() +void ValgrindTestRunnerTest::testSyscall() { const QString app("syscall"); const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -565,10 +589,13 @@ void TestRunner::syscall() } } -void TestRunner::free1() +void ValgrindTestRunnerTest::testFree1() { const QString app("free1"); const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -619,10 +646,13 @@ void TestRunner::free1() } } -void TestRunner::free2() +void ValgrindTestRunnerTest::testFree2() { const QString app("free2"); const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -677,12 +707,14 @@ void TestRunner::free2() } } -void TestRunner::invalidjump() +void ValgrindTestRunnerTest::testInvalidjump() { const QString app("invalidjump"); m_expectCrash = true; const QString binary = runTestBinary(app + QLatin1Char('/') + app); - const QString srcDir = srcDirForApp(app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); QVERIFY(m_logMessages.isEmpty()); @@ -705,11 +737,14 @@ void TestRunner::invalidjump() } -void TestRunner::overlap() +void ValgrindTestRunnerTest::testOverlap() { const QString app("overlap"); m_expectCrash = true; const QString binary = runTestBinary(app + QLatin1Char('/') + app); + if (binary.isEmpty()) + QSKIP("You need to pass BUILD_TESTS when building Qt Creator or build valgrind testapps " + "manually before executing this test."); const QString srcDir = srcDirForApp(app); QVERIFY(m_logMessages.isEmpty()); @@ -735,3 +770,6 @@ void TestRunner::overlap() QCOMPARE(QDir::cleanPath(frame.directory()), srcDir); } } + +} // namespace Test +} // namespace Valgrind diff --git a/tests/auto/valgrind/memcheck/testrunner.h b/src/plugins/valgrind/valgrindtestrunnertest.h similarity index 79% rename from tests/auto/valgrind/memcheck/testrunner.h rename to src/plugins/valgrind/valgrindtestrunnertest.h index 79eccf675a6..263f8e58760 100644 --- a/tests/auto/valgrind/memcheck/testrunner.h +++ b/src/plugins/valgrind/valgrindtestrunnertest.h @@ -29,7 +29,7 @@ #include #include -#include +#include "xmlprotocol/error.h" namespace Valgrind { @@ -41,15 +41,16 @@ namespace Memcheck { class MemcheckRunner; } -class TestRunner : public QObject +namespace Test { + +class ValgrindTestRunnerTest : public QObject { Q_OBJECT public: - explicit TestRunner(QObject *parent = 0); + explicit ValgrindTestRunnerTest(QObject *parent = 0); -private Q_SLOTS: - void initTestCase(); +private slots: void init(); void cleanup(); @@ -58,18 +59,17 @@ private Q_SLOTS: void testLeak3(); void testLeak4(); - void uninit1(); - void uninit2(); - void uninit3(); + void testUninit1(); + void testUninit2(); + void testUninit3(); - void free1(); - void free2(); + void testFree1(); + void testFree2(); - void invalidjump(); - void syscall(); - void overlap(); + void testInvalidjump(); + void testSyscall(); + void testOverlap(); -private Q_SLOTS: void logMessageReceived(const QByteArray &message); void internalError(const QString &error); void error(const Valgrind::XmlProtocol::Error &error); @@ -77,11 +77,12 @@ private Q_SLOTS: private: QString runTestBinary(const QString &binary, const QStringList &vArgs = QStringList()); - XmlProtocol::ThreadedParser *m_parser; - Memcheck::MemcheckRunner *m_runner; + XmlProtocol::ThreadedParser *m_parser = 0; + Memcheck::MemcheckRunner *m_runner = 0; QList m_logMessages; QList m_errors; - bool m_expectCrash; + bool m_expectCrash = false; }; +} // namespace Test } // namespace Valgrind diff --git a/src/shared/qbs b/src/shared/qbs index 64e336b7af5..415b873ea3d 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 64e336b7af5b863de7e8108448f9103706786714 +Subproject commit 415b873ea3d930f7853f9cf25f6c403e85e07101 diff --git a/src/tools/sdktool/addtoolchainoperation.cpp b/src/tools/sdktool/addtoolchainoperation.cpp index e194bbfdb9c..8dca1282c34 100644 --- a/src/tools/sdktool/addtoolchainoperation.cpp +++ b/src/tools/sdktool/addtoolchainoperation.cpp @@ -140,8 +140,10 @@ bool AddToolChainOperation::setArguments(const QStringList &args) if (m_id.isEmpty()) std::cerr << "No id given for tool chain." << std::endl; - if (m_languageId.isEmpty()) + if (m_languageId.isEmpty()) { std::cerr << "No language id given for tool chain." << std::endl; + m_languageId = "2"; + } if (m_displayName.isEmpty()) std::cerr << "No name given for tool chain." << std::endl; if (m_path.isEmpty()) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index cf379ad9557..e1548e8ec00 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1881,7 +1881,6 @@ void tst_Dumpers::dumper_data() "unused(&dir, &s, &fi);\n") + CoreProfile() - + UseDebugImage() + QtVersion(0x50300) + Check("dir", tempDir, "@QDir") @@ -2530,7 +2529,6 @@ void tst_Dumpers::dumper_data() "child.setObjectName(\"A renamed Child\");\n") + CoreProfile() - + UseDebugImage() // FIXME: Avoid the need. Needed for LLDB object name. + Check("child", "\"A renamed Child\"", "@QObject") + Check("parent", "\"A Parent\"", "@QObject"); @@ -2647,7 +2645,6 @@ void tst_Dumpers::dumper_data() "unused(&ob, &ob1, &ob2);\n") + GuiProfile() - + UseDebugImage() // FIXME: Needed for QObject name + Check("ob", "\"An Object\"", "@QWidget") + Check("ob1", "\"Another Object\"", "@QObject") @@ -2778,7 +2775,6 @@ void tst_Dumpers::dumper_data() "int pos2 = re.indexIn(str2); unused(&pos2);\n" "QStringList caps = re.capturedTexts(); unused(&caps);\n") + CoreProfile() - + UseDebugImage() + Check("re", "\"a(.*)b(.*)c\"", "@QRegExp") + Check("re.captures.0", "[0]", "\"a1121b344c\"", "@QString") + Check("re.captures.1", "[1]", "\"1121\"", "@QString") @@ -2850,7 +2846,6 @@ void tst_Dumpers::dumper_data() "unused(®ion0, ®ion1, ®ion2, &rects);\n") + GuiProfile() - + UseDebugImage() + Check("region0", "<0 items>", "@QRegion") + Check("region1", "<1 items>", "@QRegion") @@ -3438,7 +3433,6 @@ void tst_Dumpers::dumper_data() "}\n") + CoreProfile() - + UseDebugImage() + CheckType("this", "Thread") + Check("this.@1", "[@QThread]", "\"This is thread #3\"", "@QThread"); @@ -3700,7 +3694,6 @@ void tst_Dumpers::dumper_data() "unused(&ha1);\n") + NetworkProfile() - + UseDebugImage() + Check("ha", "\"127.0.0.1\"", "@QHostAddress") + Check("ha.a", "2130706433", TypeDef("unsigned int", "@quint32")) @@ -5948,7 +5941,6 @@ void tst_Dumpers::dumper_data() + CoreProfile() + QtVersion(0x50000) - + UseDebugImage() + Check("file", "\"A file\"", "MyFile") + Check("file.@1", "[@QFile]", "\"/tmp/tt\"", "@QFile"); @@ -6472,6 +6464,17 @@ void tst_Dumpers::dumper_data() "QtcDumperTest_FieldAccessByIndex d; unused(&d);\n") + Check("d", "12", "QtcDumperTest_FieldAccessByIndex"); + + QTest::newRow("Internal2") + << Data("struct Foo { int bar = 15; }; \n" + "struct QtcDumperTest_PointerArray {\n" + " Foo *foos = new Foo[10];\n" + "};\n\n", + "QtcDumperTest_PointerArray tc; unused(&tc);\n") + + Check("tc.0.bar", "15", "int") + + Check("tc.1.bar", "15", "int") + + Check("tc.2.bar", "15", "int") + + Check("tc.3.bar", "15", "int"); #if 0 #ifdef Q_OS_LINUX // Hint: To open a failing test in Creator, do: diff --git a/tests/auto/valgrind/memcheck/data/memcheck-output-untitled.xml b/tests/auto/valgrind/memcheck/data/memcheck-output-untitled.xml deleted file mode 100644 index d4678d6592d..00000000000 --- a/tests/auto/valgrind/memcheck/data/memcheck-output-untitled.xml +++ /dev/null @@ -1,984 +0,0 @@ - - - - -4 -memcheck - - - Memcheck, a memory error detector - Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. - Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info - Command: /home/chris/untitled/untitled - - -20854 -20386 -memcheck - - - - /usr/bin/valgrind.bin - --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp - --xml=yes - --xml-file=/tmp/bla - - - /home/chris/untitled/untitled - - - - - RUNNING - - - - - - FINISHED - - - - - 0x107 - 1 - Leak_PossiblyLost - - 120 bytes in 1 blocks are possibly lost in loss record 184 of 270 - 120 - 1 - - - - 0x402517B - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 581 - - - 0x40251D8 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - posix_memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 709 - - - 0x42BE546 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42BFA2F - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_slice_alloc - - - 0x42C06DD - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_slist_prepend - - - 0x42C368E - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_strsplit - - - 0x42D9393 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_get_language_names - - - 0x42D98E6 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42CB919 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_thread_init_glib - - - 0x4254506 - /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.2800.6 - g_thread_init - - - 0x8D4D458 - /home/chris/untitled/untitled - QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) - - - 0x85C7CA5 - /home/chris/untitled/untitled - QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() - - - - - - 0x109 - 1 - Leak_DefinitelyLost - - 122 (56 direct, 66 indirect) bytes in 1 blocks are definitely lost in loss record 186 of 270 - 122 - 1 - - - - 0x402641D - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - operator new(unsigned int) - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 255 - - - 0x8D0FC45 - /home/chris/untitled/untitled - QLibraryPrivate::findOrCreate(QString const&, QString const&) - - - 0x8D10347 - /home/chris/untitled/untitled - QLibrary::setFileNameAndVersion(QString const&, int) - - - 0x8D10404 - /home/chris/untitled/untitled - QLibrary::QLibrary(QString const&, int, QObject*) - - - 0x859BD96 - /home/chris/untitled/untitled - qt_load_library_runtime(char const*, int, int, char const*) - - - 0x859C93C - /home/chris/untitled/untitled - qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long) - - - 0x853EEDC - /home/chris/untitled/untitled - QApplicationPrivate::construct(_XDisplay*, unsigned long, unsigned long) - - - 0x853F766 - /home/chris/untitled/untitled - QApplication::QApplication(int&, char**, int) - - - 0x805209E - /home/chris/untitled/untitled - createApplication(int&, char**) - /home/chris/untitled/qmlapplicationviewer - qmlapplicationviewer.cpp - 175 - - - 0x805185F - /home/chris/untitled/untitled - main - /home/chris/untitled - main.cpp - 6 - - - - - - 0x10a - 1 - Leak_DefinitelyLost - - 124 bytes in 1 blocks are definitely lost in loss record 187 of 270 - 124 - 1 - - - - 0x4026864 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - malloc - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 236 - - - 0x4635902 - /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 - get_peer_sock_name - /build/buildd/libxcb-1.7/obj-i686-linux-gnu/src/../../src - xcb_auth.c - 259 - - - 0x4635A04 - /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 - _xcb_get_auth_info - /build/buildd/libxcb-1.7/obj-i686-linux-gnu/src/../../src - xcb_auth.c - 302 - - - 0x46353D1 - /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 - xcb_connect_to_display_with_auth_info - /build/buildd/libxcb-1.7/obj-i686-linux-gnu/src/../../src - xcb_util.c - 424 - - - 0x46355DB - /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 - xcb_connect - /build/buildd/libxcb-1.7/obj-i686-linux-gnu/src/../../src - xcb_util.c - 395 - - - 0x4169A22 - /usr/lib/i386-linux-gnu/libX11.so.6.3.0 - _XConnectXCB - - - 0x41598F3 - /usr/lib/i386-linux-gnu/libX11.so.6.3.0 - XOpenDisplay - - - 0x859E45F - /home/chris/untitled/untitled - qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long) - - - 0x853EEDC - /home/chris/untitled/untitled - QApplicationPrivate::construct(_XDisplay*, unsigned long, unsigned long) - - - 0x853F766 - /home/chris/untitled/untitled - QApplication::QApplication(int&, char**, int) - - - 0x805209E - /home/chris/untitled/untitled - createApplication(int&, char**) - /home/chris/untitled/qmlapplicationviewer - qmlapplicationviewer.cpp - 175 - - - 0x805185F - /home/chris/untitled/untitled - main - /home/chris/untitled - main.cpp - 6 - - - - - - 0x10f - 1 - Leak_DefinitelyLost - - 138 (56 direct, 82 indirect) bytes in 1 blocks are definitely lost in loss record 192 of 270 - 138 - 1 - - - - 0x402641D - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - operator new(unsigned int) - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 255 - - - 0x8D0FC45 - /home/chris/untitled/untitled - QLibraryPrivate::findOrCreate(QString const&, QString const&) - - - 0x8D10347 - /home/chris/untitled/untitled - QLibrary::setFileNameAndVersion(QString const&, int) - - - 0x8D10404 - /home/chris/untitled/untitled - QLibrary::QLibrary(QString const&, int, QObject*) - - - 0x859BD96 - /home/chris/untitled/untitled - qt_load_library_runtime(char const*, int, int, char const*) - - - 0x859DE94 - /home/chris/untitled/untitled - qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long) - - - 0x853EEDC - /home/chris/untitled/untitled - QApplicationPrivate::construct(_XDisplay*, unsigned long, unsigned long) - - - 0x853F766 - /home/chris/untitled/untitled - QApplication::QApplication(int&, char**, int) - - - 0x805209E - /home/chris/untitled/untitled - createApplication(int&, char**) - /home/chris/untitled/qmlapplicationviewer - qmlapplicationviewer.cpp - 175 - - - 0x805185F - /home/chris/untitled/untitled - main - /home/chris/untitled - main.cpp - 6 - - - - - - 0x114 - 1 - Leak_DefinitelyLost - - 158 (56 direct, 102 indirect) bytes in 1 blocks are definitely lost in loss record 197 of 270 - 158 - 1 - - - - 0x402641D - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - operator new(unsigned int) - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 255 - - - 0x8D0FC45 - /home/chris/untitled/untitled - QLibraryPrivate::findOrCreate(QString const&, QString const&) - - - 0x8D1023F - /home/chris/untitled/untitled - QLibrary::setFileNameAndVersion(QString const&, QString const&) - - - 0x8D102A4 - /home/chris/untitled/untitled - QLibrary::QLibrary(QString const&, QString const&, QObject*) - - - 0x8C8FCCD - /home/chris/untitled/untitled - qt_initIcu(QString const&) - - - 0x8C4B0CF - /home/chris/untitled/untitled - QLocalePrivate::updateSystemPrivate() - - - 0x8C4B3C6 - /home/chris/untitled/untitled - systemPrivate() - - - 0x8C4B40C - /home/chris/untitled/untitled - defaultPrivate() - - - 0x8C4B55F - /home/chris/untitled/untitled - QLocale::QLocale() - - - 0x8CCF6F3 - /home/chris/untitled/untitled - QResourceFileEngine::QResourceFileEngine(QString const&) - - - 0x8CF87DC - /home/chris/untitled/untitled - _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry&, QFileSystemMetaData&, QAbstractFileEngine*&, bool) - - - 0x8CF8947 - /home/chris/untitled/untitled - QFileSystemEngine::resolveEntryAndCreateLegacyEngine(QFileSystemEntry&, QFileSystemMetaData&) - - - - - - 0x116 - 1 - Leak_PossiblyLost - - 160 bytes in 1 blocks are possibly lost in loss record 199 of 270 - 160 - 1 - - - - 0x4025315 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - calloc - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 467 - - - 0x4010CD7 - /lib/i386-linux-gnu/ld-2.13.so - allocate_dtv - /build/buildd/eglibc-2.13/elf - dl-tls.c - 300 - - - 0x401146B - /lib/i386-linux-gnu/ld-2.13.so - _dl_allocate_tls - /build/buildd/eglibc-2.13/elf - dl-tls.c - 464 - - - 0x433E5C6 - /lib/i386-linux-gnu/libpthread-2.13.so - pthread_create@@GLIBC_2.1 - /build/buildd/eglibc-2.13/nptl - allocatestack.c - 570 - - - 0x83A6BED - /home/chris/untitled/untitled - QTWTF::TCMalloc_PageHeap::initializeScavenger() - - - 0x83A92E9 - /home/chris/untitled/untitled - QTWTF::TCMalloc_ThreadCache::InitModule() - - - 0x83AA188 - /home/chris/untitled/untitled - QTWTF::fastMalloc(unsigned int) - - - 0x83AEE4B - /home/chris/untitled/untitled - QTWTF::initializeThreading() - - - 0x8338CBF - /home/chris/untitled/untitled - QTJSC::initializeThreading() - - - 0x82897BE - /home/chris/untitled/untitled - QScriptEnginePrivate::QScriptEnginePrivate() - - - 0x828AAB2 - /home/chris/untitled/untitled - QScriptEngine::QScriptEngine() - - - 0x8063261 - /home/chris/untitled/untitled - QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate*) - - - - - - 0x117 - 1 - Leak_DefinitelyLost - - 160 (40 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 200 of 270 - 160 - 1 - - - - 0x4026864 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - malloc - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 236 - - - 0x4565FAB - /lib/i386-linux-gnu/libc-2.13.so - nss_parse_service_list - /build/buildd/eglibc-2.13/nss - nsswitch.c - 626 - - - 0x4566584 - /lib/i386-linux-gnu/libc-2.13.so - __nss_database_lookup - /build/buildd/eglibc-2.13/nss - nsswitch.c - 167 - - - 0x6BAAE9B - - - 0x6BAC9F4 - - - 0x451C7EA - /lib/i386-linux-gnu/libc-2.13.so - getpwuid_r@@GLIBC_2.1.2 - /build/buildd/eglibc-2.13/pwd/../nss - getXXbyYY_r.c - 256 - - - 0x85A34E4 - /home/chris/untitled/untitled - sm_performSaveYourself(QSessionManagerPrivate*) - - - 0x85A3F56 - /home/chris/untitled/untitled - sm_saveYourselfCallback(_SmcConn*, void*, int, int, int, int) - - - 0x4047727 - /usr/lib/i386-linux-gnu/libSM.so.6.0.1 - _SmcProcessMessage - - - 0x405D1B5 - /usr/lib/i386-linux-gnu/libICE.so.6.3.0 - IceProcessMessages - - - 0x858FE67 - /home/chris/untitled/untitled - QSmSocketReceiver::socketActivated(int) - - - 0x8D3A9C1 - /home/chris/untitled/untitled - QMetaObject::activate(QObject*, QMetaObject const*, int, void**) - - - - - - 0x118 - 1 - Leak_DefinitelyLost - - 166 (56 direct, 110 indirect) bytes in 1 blocks are definitely lost in loss record 201 of 270 - 166 - 1 - - - - 0x402641D - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - operator new(unsigned int) - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 255 - - - 0x8D0FC45 - /home/chris/untitled/untitled - QLibraryPrivate::findOrCreate(QString const&, QString const&) - - - 0x8D1023F - /home/chris/untitled/untitled - QLibrary::setFileNameAndVersion(QString const&, QString const&) - - - 0x8D102A4 - /home/chris/untitled/untitled - QLibrary::QLibrary(QString const&, QString const&, QObject*) - - - 0x8C8FA56 - /home/chris/untitled/untitled - qt_initIcu(QString const&) - - - 0x8C4B0CF - /home/chris/untitled/untitled - QLocalePrivate::updateSystemPrivate() - - - 0x8C4B3C6 - /home/chris/untitled/untitled - systemPrivate() - - - 0x8C4B40C - /home/chris/untitled/untitled - defaultPrivate() - - - 0x8C4B55F - /home/chris/untitled/untitled - QLocale::QLocale() - - - 0x8CCF6F3 - /home/chris/untitled/untitled - QResourceFileEngine::QResourceFileEngine(QString const&) - - - 0x8CF87DC - /home/chris/untitled/untitled - _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry&, QFileSystemMetaData&, QAbstractFileEngine*&, bool) - - - 0x8CF8947 - /home/chris/untitled/untitled - QFileSystemEngine::resolveEntryAndCreateLegacyEngine(QFileSystemEntry&, QFileSystemMetaData&) - - - - - - 0x11d - 1 - Leak_DefinitelyLost - - 216 bytes in 1 blocks are definitely lost in loss record 206 of 270 - 216 - 1 - - - - 0x4026864 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - malloc - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 236 - - - 0x4193FB2 - /usr/lib/i386-linux-gnu/libX11.so.6.3.0 - _XimOpenIM - - - 0x4193BCF - /usr/lib/i386-linux-gnu/libX11.so.6.3.0 - _XimRegisterIMInstantiateCallback - - - 0x41789A7 - /usr/lib/i386-linux-gnu/libX11.so.6.3.0 - XRegisterIMInstantiateCallback - - - 0x89FB291 - /home/chris/untitled/untitled - QXIMInputContext::QXIMInputContext() - - - 0x89F9450 - /home/chris/untitled/untitled - QInputContextFactory::create(QString const&, QObject*) - - - 0x85361C7 - /home/chris/untitled/untitled - QApplication::inputContext() const - - - 0x85662A7 - /home/chris/untitled/untitled - QWidgetPrivate::inputContext() const - - - 0x8571D7C - /home/chris/untitled/untitled - QWidget::setAttribute(Qt::WidgetAttribute, bool) - - - 0x8A54527 - /home/chris/untitled/untitled - QGraphicsViewPrivate::updateInputMethodSensitivity() - - - 0x8A55E1A - /home/chris/untitled/untitled - QGraphicsView::setScene(QGraphicsScene*) - - - 0x805273E - /home/chris/untitled/untitled - QDeclarativeViewPrivate::init() - - - - - - 0x126 - 1 - Leak_PossiblyLost - - 360 bytes in 3 blocks are possibly lost in loss record 215 of 270 - 360 - 3 - - - - 0x402517B - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 581 - - - 0x40251D8 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - posix_memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 709 - - - 0x42BE546 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42BFA4C - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_slice_alloc - - - 0x42C06DD - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_slist_prepend - - - 0x42C368E - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_strsplit - - - 0x42D9393 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_get_language_names - - - 0x42D98E6 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42CB919 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_thread_init_glib - - - 0x4254506 - /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.2800.6 - g_thread_init - - - 0x8D4D458 - /home/chris/untitled/untitled - QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) - - - 0x85C7CA5 - /home/chris/untitled/untitled - QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() - - - - - - 0x128 - 1 - Leak_DefinitelyLost - - 396 (256 direct, 140 indirect) bytes in 2 blocks are definitely lost in loss record 217 of 270 - 396 - 2 - - - - 0x4026864 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - malloc - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 236 - - - 0x4086087 - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - - - 0x4086F7C - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - - - 0x4087073 - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - - - 0x408C6EB - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - - - 0x4607790 - /lib/i386-linux-gnu/libexpat.so.1.5.2 - - - 0x4608670 - /lib/i386-linux-gnu/libexpat.so.1.5.2 - - - 0x4608F92 - /lib/i386-linux-gnu/libexpat.so.1.5.2 - - - 0x460A7D9 - /lib/i386-linux-gnu/libexpat.so.1.5.2 - - - 0x460C5F2 - /lib/i386-linux-gnu/libexpat.so.1.5.2 - XML_ParseBuffer - - - 0x408B2B2 - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - FcConfigParseAndLoad - - - 0x408B60B - /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4 - FcConfigParseAndLoad - - - - - - 0x144 - 1 - Leak_PossiblyLost - - 1,240 bytes in 5 blocks are possibly lost in loss record 245 of 270 - 1240 - 5 - - - - 0x402517B - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 581 - - - 0x40251D8 - /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so - posix_memalign - /build/buildd/valgrind-3.6.1/coregrind/m_replacemalloc - vg_replace_malloc.c - 709 - - - 0x42BE546 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42BFA4C - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_slice_alloc - - - 0x42729D8 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_array_sized_new - - - 0x4272AB2 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_array_new - - - 0x42CB7FE - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_static_private_set - - - 0x4282D0E - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_get_filename_charsets - - - 0x4282D9C - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - - - 0x42CB909 - /lib/i386-linux-gnu/libglib-2.0.so.0.2800.6 - g_thread_init_glib - - - 0x4254506 - /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.2800.6 - g_thread_init - - - 0x8D4D458 - /home/chris/untitled/untitled - QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) - - - - - - - - - - 80 - U1004-ARM-_dl_relocate_object - - - - - diff --git a/tests/auto/valgrind/memcheck/memcheck.pro b/tests/auto/valgrind/memcheck/memcheck.pro index 89ac9529618..ca8134e6264 100644 --- a/tests/auto/valgrind/memcheck/memcheck.pro +++ b/tests/auto/valgrind/memcheck/memcheck.pro @@ -1,16 +1,9 @@ TEMPLATE = subdirs -parsertests.file = parsertests.pro - # avoid race conditions when compiling shadowbuild and having more than one compile job -modeldemo.depends = parsertests modeldemo.file = modeldemo.pro +testapps.depends = modeldemo -testapps.depends = modeldemo parsertests - -testrunner.file = testrunner.pro -testrunner.depends = testapps - -SUBDIRS += parsertests modeldemo testapps testrunner +SUBDIRS += modeldemo testapps diff --git a/tests/auto/valgrind/memcheck/memcheck.qbs b/tests/auto/valgrind/memcheck/memcheck.qbs index 531319c8117..c633a605a39 100644 --- a/tests/auto/valgrind/memcheck/memcheck.qbs +++ b/tests/auto/valgrind/memcheck/memcheck.qbs @@ -4,8 +4,6 @@ Project { name: "Memcheck autotests" references: [ "testapps/testapps.qbs", - "modeldemo.qbs", - "parsertests.qbs", - "testrunner.qbs" + "modeldemo.qbs" ] } diff --git a/tests/auto/valgrind/memcheck/parsertests.pro b/tests/auto/valgrind/memcheck/parsertests.pro deleted file mode 100644 index b4f829804df..00000000000 --- a/tests/auto/valgrind/memcheck/parsertests.pro +++ /dev/null @@ -1,14 +0,0 @@ -QTC_LIB_DEPENDS += utils ssh -QTC_PLUGIN_DEPENDS += debugger projectexplorer -include(../../qttest.pri) -include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri) - -TARGET = tst_parsertests - -QT += network - -DEFINES += "PARSERTESTS_DATA_DIR=\\\"$$_PRO_FILE_PWD_/data\\\"" -DEFINES += "VALGRIND_FAKE_PATH=\\\"$$IDE_BUILD_TREE/src/tools/valgrindfake/valgrind-fake\\\"" - -SOURCES += parsertests.cpp -HEADERS += parsertests.h diff --git a/tests/auto/valgrind/memcheck/parsertests.qbs b/tests/auto/valgrind/memcheck/parsertests.qbs deleted file mode 100644 index 99d6f6474f8..00000000000 --- a/tests/auto/valgrind/memcheck/parsertests.qbs +++ /dev/null @@ -1,13 +0,0 @@ -import qbs -import "../valgrindautotest.qbs" as ValgrindAutotest - -ValgrindAutotest { - name: "Memcheck parser autotest" - Depends { name: "valgrind-fake" } - Depends { name: "Qt.network" } - files: ["parsertests.h", "parsertests.cpp"] - cpp.defines: base.concat([ - 'PARSERTESTS_DATA_DIR="' + path + '/data"', - 'VALGRIND_FAKE_PATH="' + project.buildDirectory + '/' + qtc.ide_bin_path + '/valgrind-fake"' - ]) -} diff --git a/tests/auto/valgrind/memcheck/testrunner.pro b/tests/auto/valgrind/memcheck/testrunner.pro deleted file mode 100644 index b0b07ea394d..00000000000 --- a/tests/auto/valgrind/memcheck/testrunner.pro +++ /dev/null @@ -1,12 +0,0 @@ -QTC_LIB_DEPENDS += utils ssh -QTC_PLUGIN_DEPENDS += debugger projectexplorer -include(../../qttest.pri) -include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri) - -TARGET = tst_testrunner - -DEFINES += "TESTRUNNER_SRC_DIR=\\\"$$_PRO_FILE_PWD_/testapps\\\"" -DEFINES += "TESTRUNNER_APP_DIR=\\\"$(PWD)/testapps\\\"" - -SOURCES += testrunner.cpp -HEADERS += testrunner.h diff --git a/tests/auto/valgrind/memcheck/testrunner.qbs b/tests/auto/valgrind/memcheck/testrunner.qbs deleted file mode 100644 index 4d0e76cb028..00000000000 --- a/tests/auto/valgrind/memcheck/testrunner.qbs +++ /dev/null @@ -1,24 +0,0 @@ -import qbs -import "../valgrindautotest.qbs" as ValgrindAutotest - -ValgrindAutotest { - name: "Memcheck test runner" - Depends { name: "Memcheck free1 autotest" } - Depends { name: "Memcheck free2 autotest" } - Depends { name: "Memcheck invalidjump autotest" } - Depends { name: "Memcheck leak1 autotest" } - Depends { name: "Memcheck leak2 autotest" } - Depends { name: "Memcheck leak3 autotest" } - Depends { name: "Memcheck leak4 autotest" } - Depends { name: "Memcheck overlap autotest" } - Depends { name: "Memcheck syscall autotest" } - Depends { name: "Memcheck uninit1 autotest" } - Depends { name: "Memcheck uninit2 autotest" } - Depends { name: "Memcheck uninit3 autotest" } - files: ["testrunner.h", "testrunner.cpp"] - destinationDirectory: qtc.ide_bin_path - cpp.defines: base.concat([ - 'TESTRUNNER_SRC_DIR="' + path + '/testapps"', - 'TESTRUNNER_APP_DIR="' + project.buildDirectory + '/' + destinationDirectory + '/testapps"' - ]) -}