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

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,9 @@
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of Qt Creator. ** This file is part of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
@@ -21,6 +22,8 @@
** information to ensure the GNU General Public License requirements will ** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
** **
** $QT_END_LICENSE$
**
****************************************************************************/ ****************************************************************************/
// //
@@ -35,231 +38,234 @@
// //
// This file was generated by qlalr - DO NOT EDIT! // This file was generated by qlalr - DO NOT EDIT!
#pragma once #ifndef GLSLPARSERTABLE_P_H
#define GLSLPARSERTABLE_P_H
#include <qglobal.h> #include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class GLSLParserTable class GLSLParserTable
{ {
public: public:
enum VariousConstants { enum VariousConstants {
EOF_SYMBOL = 0, EOF_SYMBOL = 0,
T_ADD_ASSIGN = 3, T_ADD_ASSIGN = 3,
T_AMPERSAND = 4, T_AMPERSAND = 4,
T_AND_ASSIGN = 5, T_AND_ASSIGN = 5,
T_AND_OP = 6, T_AND_OP = 6,
T_ATTRIBUTE = 7, T_ATTRIBUTE = 7,
T_BANG = 8, T_BANG = 8,
T_BOOL = 9, T_BOOL = 9,
T_BREAK = 10, T_BREAK = 10,
T_BVEC2 = 11, T_BVEC2 = 11,
T_BVEC3 = 12, T_BVEC3 = 12,
T_BVEC4 = 13, T_BVEC4 = 13,
T_CARET = 14, T_CARET = 14,
T_CASE = 15, T_CASE = 15,
T_CENTROID = 16, T_CENTROID = 16,
T_COLON = 17, T_COLON = 17,
T_COMMA = 18, T_COMMA = 18,
T_COMMENT = 172, T_COMMENT = 172,
T_CONST = 19, T_CONST = 19,
T_CONTINUE = 20, T_CONTINUE = 20,
T_DASH = 21, T_DASH = 21,
T_DEC_OP = 22, T_DEC_OP = 22,
T_DEFAULT = 23, T_DEFAULT = 23,
T_DISCARD = 24, T_DISCARD = 24,
T_DIV_ASSIGN = 25, T_DIV_ASSIGN = 25,
T_DMAT2 = 26, T_DMAT2 = 26,
T_DMAT2X2 = 27, T_DMAT2X2 = 27,
T_DMAT2X3 = 28, T_DMAT2X3 = 28,
T_DMAT2X4 = 29, T_DMAT2X4 = 29,
T_DMAT3 = 30, T_DMAT3 = 30,
T_DMAT3X2 = 31, T_DMAT3X2 = 31,
T_DMAT3X3 = 32, T_DMAT3X3 = 32,
T_DMAT3X4 = 33, T_DMAT3X4 = 33,
T_DMAT4 = 34, T_DMAT4 = 34,
T_DMAT4X2 = 35, T_DMAT4X2 = 35,
T_DMAT4X3 = 36, T_DMAT4X3 = 36,
T_DMAT4X4 = 37, T_DMAT4X4 = 37,
T_DO = 38, T_DO = 38,
T_DOT = 39, T_DOT = 39,
T_DOUBLE = 40, T_DOUBLE = 40,
T_DVEC2 = 41, T_DVEC2 = 41,
T_DVEC3 = 42, T_DVEC3 = 42,
T_DVEC4 = 43, T_DVEC4 = 43,
T_ELSE = 44, T_ELSE = 44,
T_EQUAL = 45, T_EQUAL = 45,
T_EQ_OP = 46, T_EQ_OP = 46,
T_ERROR = 173, T_ERROR = 173,
T_FALSE = 170, T_FALSE = 170,
T_FEED_EXPRESSION = 2, T_FEED_EXPRESSION = 2,
T_FEED_GLSL = 1, T_FEED_GLSL = 1,
T_FLAT = 47, T_FLAT = 47,
T_FLOAT = 48, T_FLOAT = 48,
T_FOR = 49, T_FOR = 49,
T_GE_OP = 50, T_GE_OP = 50,
T_HIGHP = 51, T_HIGHP = 51,
T_IDENTIFIER = 52, T_IDENTIFIER = 52,
T_IF = 53, T_IF = 53,
T_IN = 54, T_IN = 54,
T_INC_OP = 55, T_INC_OP = 55,
T_INOUT = 56, T_INOUT = 56,
T_INT = 57, T_INT = 57,
T_INVARIANT = 58, T_INVARIANT = 58,
T_ISAMPLER1D = 59, T_ISAMPLER1D = 59,
T_ISAMPLER1DARRAY = 60, T_ISAMPLER1DARRAY = 60,
T_ISAMPLER2D = 61, T_ISAMPLER2D = 61,
T_ISAMPLER2DARRAY = 62, T_ISAMPLER2DARRAY = 62,
T_ISAMPLER2DMS = 63, T_ISAMPLER2DMS = 63,
T_ISAMPLER2DMSARRAY = 64, T_ISAMPLER2DMSARRAY = 64,
T_ISAMPLER2DRECT = 65, T_ISAMPLER2DRECT = 65,
T_ISAMPLER3D = 66, T_ISAMPLER3D = 66,
T_ISAMPLERBUFFER = 67, T_ISAMPLERBUFFER = 67,
T_ISAMPLERCUBE = 68, T_ISAMPLERCUBE = 68,
T_ISAMPLERCUBEARRAY = 69, T_ISAMPLERCUBEARRAY = 69,
T_IVEC2 = 70, T_IVEC2 = 70,
T_IVEC3 = 71, T_IVEC3 = 71,
T_IVEC4 = 72, T_IVEC4 = 72,
T_LAYOUT = 73, T_LAYOUT = 73,
T_LEFT_ANGLE = 74, T_LEFT_ANGLE = 74,
T_LEFT_ASSIGN = 75, T_LEFT_ASSIGN = 75,
T_LEFT_BRACE = 76, T_LEFT_BRACE = 76,
T_LEFT_BRACKET = 77, T_LEFT_BRACKET = 77,
T_LEFT_OP = 78, T_LEFT_OP = 78,
T_LEFT_PAREN = 79, T_LEFT_PAREN = 79,
T_LE_OP = 80, T_LE_OP = 80,
T_LOWP = 81, T_LOWP = 81,
T_MAT2 = 82, T_MAT2 = 82,
T_MAT2X2 = 83, T_MAT2X2 = 83,
T_MAT2X3 = 84, T_MAT2X3 = 84,
T_MAT2X4 = 85, T_MAT2X4 = 85,
T_MAT3 = 86, T_MAT3 = 86,
T_MAT3X2 = 87, T_MAT3X2 = 87,
T_MAT3X3 = 88, T_MAT3X3 = 88,
T_MAT3X4 = 89, T_MAT3X4 = 89,
T_MAT4 = 90, T_MAT4 = 90,
T_MAT4X2 = 91, T_MAT4X2 = 91,
T_MAT4X3 = 92, T_MAT4X3 = 92,
T_MAT4X4 = 93, T_MAT4X4 = 93,
T_MEDIUMP = 94, T_MEDIUMP = 94,
T_MOD_ASSIGN = 95, T_MOD_ASSIGN = 95,
T_MUL_ASSIGN = 96, T_MUL_ASSIGN = 96,
T_NE_OP = 97, T_NE_OP = 97,
T_NOPERSPECTIVE = 98, T_NOPERSPECTIVE = 98,
T_NUMBER = 99, T_NUMBER = 99,
T_OR_ASSIGN = 100, T_OR_ASSIGN = 100,
T_OR_OP = 101, T_OR_OP = 101,
T_OUT = 102, T_OUT = 102,
T_PATCH = 103, T_PATCH = 103,
T_PERCENT = 104, T_PERCENT = 104,
T_PLUS = 105, T_PLUS = 105,
T_PRECISION = 106, T_PRECISION = 106,
T_PREPROC = 171, T_PREPROC = 171,
T_QUESTION = 107, T_QUESTION = 107,
T_RESERVED = 174, T_RESERVED = 174,
T_RETURN = 108, T_RETURN = 108,
T_RIGHT_ANGLE = 109, T_RIGHT_ANGLE = 109,
T_RIGHT_ASSIGN = 110, T_RIGHT_ASSIGN = 110,
T_RIGHT_BRACE = 111, T_RIGHT_BRACE = 111,
T_RIGHT_BRACKET = 112, T_RIGHT_BRACKET = 112,
T_RIGHT_OP = 113, T_RIGHT_OP = 113,
T_RIGHT_PAREN = 114, T_RIGHT_PAREN = 114,
T_SAMPLE = 115, T_SAMPLE = 115,
T_SAMPLER1D = 116, T_SAMPLER1D = 116,
T_SAMPLER1DARRAY = 117, T_SAMPLER1DARRAY = 117,
T_SAMPLER1DARRAYSHADOW = 118, T_SAMPLER1DARRAYSHADOW = 118,
T_SAMPLER1DSHADOW = 119, T_SAMPLER1DSHADOW = 119,
T_SAMPLER2D = 120, T_SAMPLER2D = 120,
T_SAMPLER2DARRAY = 121, T_SAMPLER2DARRAY = 121,
T_SAMPLER2DARRAYSHADOW = 122, T_SAMPLER2DARRAYSHADOW = 122,
T_SAMPLER2DMS = 123, T_SAMPLER2DMS = 123,
T_SAMPLER2DMSARRAY = 124, T_SAMPLER2DMSARRAY = 124,
T_SAMPLER2DRECT = 125, T_SAMPLER2DRECT = 125,
T_SAMPLER2DRECTSHADOW = 126, T_SAMPLER2DRECTSHADOW = 126,
T_SAMPLER2DSHADOW = 127, T_SAMPLER2DSHADOW = 127,
T_SAMPLER3D = 128, T_SAMPLER3D = 128,
T_SAMPLERBUFFER = 129, T_SAMPLERBUFFER = 129,
T_SAMPLERCUBE = 130, T_SAMPLERCUBE = 130,
T_SAMPLERCUBEARRAY = 131, T_SAMPLERCUBEARRAY = 131,
T_SAMPLERCUBEARRAYSHADOW = 132, T_SAMPLERCUBEARRAYSHADOW = 132,
T_SAMPLERCUBESHADOW = 133, T_SAMPLERCUBESHADOW = 133,
T_SEMICOLON = 134, T_SEMICOLON = 134,
T_SLASH = 135, T_SLASH = 135,
T_SMOOTH = 136, T_SMOOTH = 136,
T_STAR = 137, T_STAR = 137,
T_STRUCT = 138, T_STRUCT = 138,
T_SUBROUTINE = 139, T_SUBROUTINE = 139,
T_SUB_ASSIGN = 140, T_SUB_ASSIGN = 140,
T_SWITCH = 141, T_SWITCH = 141,
T_TILDE = 142, T_TILDE = 142,
T_TRUE = 169, T_TRUE = 169,
T_TYPE_NAME = 143, T_TYPE_NAME = 143,
T_UINT = 144, T_UINT = 144,
T_UNIFORM = 145, T_UNIFORM = 145,
T_USAMPLER1D = 146, T_USAMPLER1D = 146,
T_USAMPLER1DARRAY = 147, T_USAMPLER1DARRAY = 147,
T_USAMPLER2D = 148, T_USAMPLER2D = 148,
T_USAMPLER2DARRAY = 149, T_USAMPLER2DARRAY = 149,
T_USAMPLER2DMS = 150, T_USAMPLER2DMS = 150,
T_USAMPLER2DMSARRAY = 151, T_USAMPLER2DMSARRAY = 151,
T_USAMPLER2DRECT = 152, T_USAMPLER2DRECT = 152,
T_USAMPLER3D = 153, T_USAMPLER3D = 153,
T_USAMPLERBUFFER = 154, T_USAMPLERBUFFER = 154,
T_USAMPLERCUBE = 155, T_USAMPLERCUBE = 155,
T_USAMPLERCUBEARRAY = 156, T_USAMPLERCUBEARRAY = 156,
T_UVEC2 = 157, T_UVEC2 = 157,
T_UVEC3 = 158, T_UVEC3 = 158,
T_UVEC4 = 159, T_UVEC4 = 159,
T_VARYING = 160, T_VARYING = 160,
T_VEC2 = 161, T_VEC2 = 161,
T_VEC3 = 162, T_VEC3 = 162,
T_VEC4 = 163, T_VEC4 = 163,
T_VERTICAL_BAR = 164, T_VERTICAL_BAR = 164,
T_VOID = 165, T_VOID = 165,
T_WHILE = 166, T_WHILE = 166,
T_XOR_ASSIGN = 167, T_XOR_ASSIGN = 167,
T_XOR_OP = 168, T_XOR_OP = 168,
ACCEPT_STATE = 462, ACCEPT_STATE = 462,
RULE_COUNT = 316, RULE_COUNT = 316,
STATE_COUNT = 463, STATE_COUNT = 463,
TERMINAL_COUNT = 175, TERMINAL_COUNT = 175,
NON_TERMINAL_COUNT = 85, NON_TERMINAL_COUNT = 85,
GOTO_INDEX_OFFSET = 463, GOTO_INDEX_OFFSET = 463,
GOTO_INFO_OFFSET = 4681, GOTO_INFO_OFFSET = 4708,
GOTO_CHECK_OFFSET = 4681 GOTO_CHECK_OFFSET = 4708
}; };
static const char *const spell []; static const char *const spell[];
static const short lhs []; static const short lhs[];
static const short rhs []; static const short rhs[];
static const short goto_default []; static const short goto_default[];
static const short action_default []; static const short action_default[];
static const short action_index []; static const short action_index[];
static const short action_info []; static const short action_info[];
static const short action_check []; static const short action_check[];
static inline int nt_action (int state, int nt) static inline int nt_action (int state, int nt)
{ {
const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
return goto_default [nt]; return goto_default [nt];
return action_info [GOTO_INFO_OFFSET + yyn]; return action_info [GOTO_INFO_OFFSET + yyn];
} }
static inline int t_action (int state, int token) static inline int t_action (int state, int token)
{ {
const int yyn = action_index [state] + token; const int yyn = action_index [state] + token;
if (yyn < 0 || action_check [yyn] != token) if (yyn < 0 || action_check [yyn] != token)
return - action_default [state]; return - action_default [state];
return action_info [yyn]; return action_info [yyn];
} }
}; };
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // GLSLPARSERTABLE_P_H

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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