aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-06-02 15:03:36 +0300
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-06-02 15:13:51 +0300
commit89057b552b0b9bbe24d4e3552e12ae94aa713fa8 (patch)
treeed1dfaa961828b6e08e7f348d7567cf8b2248320 /src/libs
parenta9d511ff7d3e42c6f516a98c036c624e969be2d8 (diff)
parentec3015663a536ebeb96a24b5cf5643b4324f6c54 (diff)
Merge remote-tracking branch 'origin/4.3'
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/3rdparty/cplusplus/Symbols.h2
-rw-r--r--src/libs/libs.pro8
-rw-r--r--src/libs/qtcreatorcdbext/pytype.cpp9
-rw-r--r--src/libs/qtcreatorcdbext/qtcreatorcdbext.pro2
-rw-r--r--src/libs/utils/fileutils.h27
5 files changed, 46 insertions, 2 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbols.h b/src/libs/3rdparty/cplusplus/Symbols.h
index 4cd8141beb..e29f78bf01 100644
--- a/src/libs/3rdparty/cplusplus/Symbols.h
+++ b/src/libs/3rdparty/cplusplus/Symbols.h
@@ -503,7 +503,7 @@ protected:
virtual void visitSymbol0(SymbolVisitor *visitor);
private:
- bool _isVariadic;
+ bool _isVariadic = false;
bool _isVirtual;
FullySpecifiedType _type;
};
diff --git a/src/libs/libs.pro b/src/libs/libs.pro
index 34a5d938bf..178a7a4cb8 100644
--- a/src/libs/libs.pro
+++ b/src/libs/libs.pro
@@ -38,5 +38,11 @@ win32:SUBDIRS += utils/process_ctrlc_stub.pro
# Windows: Compile Qt Creator CDB extension if Debugging tools can be detected.
win32: isEmpty(QTC_SKIP_CDBEXT) {
include(qtcreatorcdbext/cdb_detect.pri)
- exists($$CDB_PATH):SUBDIRS += qtcreatorcdbext
+ exists($$CDB_PATH) {
+ SUBDIRS += qtcreatorcdbext
+ } else {
+ message("Compiling Qt Creator without a CDB extension.")
+ message("If CDB is installed in a none default path define a CDB_PATH")
+ message("environment variable pointing to your CDB installation.")
+ }
}
diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp
index 2525a65114..ec67771824 100644
--- a/src/libs/qtcreatorcdbext/pytype.cpp
+++ b/src/libs/qtcreatorcdbext/pytype.cpp
@@ -40,6 +40,8 @@
#include <dbghelp.h>
#endif
+#include <regex>
+
constexpr bool debugPyType = false;
constexpr bool debuggingTypeEnabled() { return debugPyType || debugPyCdbextModule; }
@@ -289,6 +291,9 @@ int PyType::code() const
if (FAILED(ExtensionCommandContext::instance()->symbols()->CreateSymbolGroup2(&sg)))
return TypeCodeStruct;
+ if (knownType(name(), 0) != KT_Unknown)
+ return TypeCodeStruct;
+
const std::string helperValueName = SymbolGroupValue::pointedToSymbolName(0, name(true));
ULONG index = DEBUG_ANY_ID;
if (SUCCEEDED(sg->AddSymbol(helperValueName.c_str(), &index)))
@@ -411,6 +416,10 @@ PyType PyType::lookupType(const std::string &typeNameIn, ULONG64 module)
if (typeName == "__int64" || typeName == "unsigned __int64")
typeName.erase(typeName.find("__"), 2);
+ const static std::regex typeNameRE("^[a-zA-Z_][a-zA-Z0-9_]*!?[a-zA-Z0-9_<>:, \\*\\&\\[\\]]*$");
+ if (!std::regex_match(typeName, typeNameRE))
+ return PyType();
+
CIDebugSymbols *symbols = ExtensionCommandContext::instance()->symbols();
ULONG typeId;
HRESULT result = S_FALSE;
diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro b/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro
index 058ed485b6..545656dc24 100644
--- a/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro
+++ b/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro
@@ -138,6 +138,8 @@ exists($$PYTHON_INSTALL_DIR) {
CONFIG(release, debug|release): deploy_python.recurse = Release
CONFIG(debug, debug|release): deploy_python.recurse = Debug
QMAKE_EXTRA_TARGETS += deploy_python
+} else {
+ message("Set PYTHON_INSTALL_DIR pointing to Python 3.5 or greater to enable the python dumpers for cdb.")
}
target.path = $$QTC_PREFIX/lib/$${DIRNAME} # TODO this should go to INSTALL_LIBRARY_PATH/$${DIRNAME}
diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h
index e1c3b47128..fc6d80f729 100644
--- a/src/libs/utils/fileutils.h
+++ b/src/libs/utils/fileutils.h
@@ -49,6 +49,11 @@ class QWidget;
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FileName &c);
+// for withNTFSPermissions
+#ifdef Q_OS_WIN
+extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
+#endif
+
QT_END_NAMESPACE
namespace Utils {
@@ -121,6 +126,28 @@ public:
static QString resolvePath(const QString &baseDir, const QString &fileName);
};
+// for actually finding out if e.g. directories are writable on Windows
+#ifdef Q_OS_WIN
+
+template <typename T>
+static T withNTFSPermissions(const std::function<T()> &task)
+{
+ qt_ntfs_permission_lookup++;
+ T result = task();
+ qt_ntfs_permission_lookup--;
+ return result;
+}
+
+#else // Q_OS_WIN
+
+template <typename T>
+static T withNTFSPermissions(const std::function<T()> &task)
+{
+ return task();
+}
+
+#endif // Q_OS_WIN
+
class QTCREATOR_UTILS_EXPORT FileReader
{
Q_DECLARE_TR_FUNCTIONS(Utils::FileUtils) // sic!