forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.7'
Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri Change-Id: I3d42bd52fb7b977cfdfad83092fb6f6eac974e24
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
@@ -405,6 +405,13 @@
|
|||||||
The CPU Usage Analyzer might fail to record data for the following reasons:
|
The CPU Usage Analyzer might fail to record data for the following reasons:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
\li Perf events may be globally disabled on your system. The
|
||||||
|
preconfigured Boot to Qt images come with perf events enabled. For
|
||||||
|
a custom configuration you need to make sure that the file
|
||||||
|
\c {/proc/sys/kernel/perf_event_paranoid} contains a value smaller
|
||||||
|
than \c {2}. For maximum flexibility in recording traces you can
|
||||||
|
set the value to \c {-1}. This allows any user to record any kind
|
||||||
|
of trace, even using raw kernel trace points.
|
||||||
\li The connection between the target device and the host may not be
|
\li The connection between the target device and the host may not be
|
||||||
fast enough to transfer the data produced by Perf. Try modifying
|
fast enough to transfer the data produced by Perf. Try modifying
|
||||||
the values of the \uicontrol {Stack snapshot size} or
|
the values of the \uicontrol {Stack snapshot size} or
|
||||||
|
|||||||
@@ -219,7 +219,11 @@
|
|||||||
|
|
||||||
\li To stop synchronizing the position in the project tree with the file
|
\li To stop synchronizing the position in the project tree with the file
|
||||||
currently opened in the editor, deselect \inlineimage linkicon.png
|
currently opened in the editor, deselect \inlineimage linkicon.png
|
||||||
(\uicontrol {Synchronize with Editor}).
|
(\uicontrol {Synchronize with Editor}). You can specify a keyboard
|
||||||
|
shortcut to use when synchronization is needed. Select
|
||||||
|
\uicontrol Tools > \uicontrol Options > \uicontrol Environment >
|
||||||
|
\uicontrol Keyboard, and then search for
|
||||||
|
\uicontrol {Show in Explorer}.
|
||||||
|
|
||||||
\li To see the absolute path of a file, move the mouse pointer over the
|
\li To see the absolute path of a file, move the mouse pointer over the
|
||||||
file name.
|
file name.
|
||||||
@@ -263,7 +267,10 @@
|
|||||||
\image qtcreator-filesystem-view.png
|
\image qtcreator-filesystem-view.png
|
||||||
|
|
||||||
By default, the contents of the directory that contains the file currently
|
By default, the contents of the directory that contains the file currently
|
||||||
active in the editor are displayed. The path to the active file is displayed
|
active in the editor are displayed. To stop the synchronization, delesect
|
||||||
|
the \uicontrol {Synchronize Root Directory with Editor} button.
|
||||||
|
|
||||||
|
The path to the active file is displayed
|
||||||
as bread crumbs. You can move to any directory along the path by clicking
|
as bread crumbs. You can move to any directory along the path by clicking
|
||||||
it. To hide the bread crumbs, select \inlineimage filtericon.png
|
it. To hide the bread crumbs, select \inlineimage filtericon.png
|
||||||
(\uicontrol Options) and then deselect the \uicontrol {Show Bread Crumbs}
|
(\uicontrol Options) and then deselect the \uicontrol {Show Bread Crumbs}
|
||||||
|
|||||||
2
src/libs/3rdparty/botan/botan.cpp
vendored
2
src/libs/3rdparty/botan/botan.cpp
vendored
@@ -465,7 +465,7 @@ inline V search_map(const std::map<K, V>& mapping,
|
|||||||
* Function adaptor for delete operation
|
* Function adaptor for delete operation
|
||||||
*/
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
class del_fun : public std::unary_function<T, void>
|
class del_fun
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void operator()(T* ptr) { delete ptr; }
|
void operator()(T* ptr) { delete ptr; }
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/Name.h
vendored
2
src/libs/3rdparty/cplusplus/Name.h
vendored
@@ -59,7 +59,7 @@ public:
|
|||||||
bool match(const Name *other, Matcher *matcher = 0) const;
|
bool match(const Name *other, Matcher *matcher = 0) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct Compare: std::binary_function<const Name *, const Name *, bool> {
|
struct Compare {
|
||||||
bool operator()(const Name *name, const Name *other) const;
|
bool operator()(const Name *name, const Name *other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/Names.h
vendored
2
src/libs/3rdparty/cplusplus/Names.h
vendored
@@ -101,7 +101,7 @@ public:
|
|||||||
bool isSpecialization() const { return _isSpecialization; }
|
bool isSpecialization() const { return _isSpecialization; }
|
||||||
|
|
||||||
// Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map)
|
// Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map)
|
||||||
struct Compare: std::binary_function<const TemplateNameId *, const TemplateNameId *, bool> {
|
struct Compare {
|
||||||
bool operator()(const TemplateNameId *name, const TemplateNameId *other) const;
|
bool operator()(const TemplateNameId *name, const TemplateNameId *other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "clangcodemodelconnectionclient.h"
|
#include "clangcodemodelconnectionclient.h"
|
||||||
|
|
||||||
|
#include <utils/environment.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@@ -50,6 +51,11 @@ ClangCodeModelConnectionClient::ClangCodeModelConnectionClient(
|
|||||||
m_processCreator.setTemporaryDirectoryPattern("clangbackend-XXXXXX");
|
m_processCreator.setTemporaryDirectoryPattern("clangbackend-XXXXXX");
|
||||||
m_processCreator.setArguments({connectionName()});
|
m_processCreator.setArguments({connectionName()});
|
||||||
|
|
||||||
|
Utils::Environment environment;
|
||||||
|
environment.set(QStringLiteral("LIBCLANG_NOTHREADS"), QString());
|
||||||
|
environment.set(QStringLiteral("LIBCLANG_DISABLE_CRASH_RECOVERY"), QString());
|
||||||
|
m_processCreator.setEnvironment(environment);
|
||||||
|
|
||||||
stdErrPrefixer().setPrefix("clangbackend.stderr: ");
|
stdErrPrefixer().setPrefix("clangbackend.stderr: ");
|
||||||
stdOutPrefixer().setPrefix("clangbackend.stdout: ");
|
stdOutPrefixer().setPrefix("clangbackend.stdout: ");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ void ProcessCreator::setArguments(const QStringList &arguments)
|
|||||||
m_arguments = arguments;
|
m_arguments = arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessCreator::setEnvironment(const Utils::Environment &environment)
|
||||||
|
{
|
||||||
|
m_environment = environment;
|
||||||
|
}
|
||||||
|
|
||||||
std::future<QProcessUniquePointer> ProcessCreator::createProcess() const
|
std::future<QProcessUniquePointer> ProcessCreator::createProcess() const
|
||||||
{
|
{
|
||||||
return std::async(std::launch::async, [&] {
|
return std::async(std::launch::async, [&] {
|
||||||
@@ -167,6 +172,10 @@ QProcessEnvironment ProcessCreator::processEnvironment() const
|
|||||||
processEnvironment.insert("TEMP", temporaryDirectoryPath);
|
processEnvironment.insert("TEMP", temporaryDirectoryPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Utils::Environment &env = m_environment;
|
||||||
|
for (auto it = env.constBegin(); it != env.constEnd(); ++it)
|
||||||
|
processEnvironment.insert(it.key(), it.value());
|
||||||
|
|
||||||
return processEnvironment;
|
return processEnvironment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "processhandle.h"
|
#include "processhandle.h"
|
||||||
|
|
||||||
|
#include <utils/environment.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -51,6 +52,7 @@ public:
|
|||||||
void setTemporaryDirectoryPattern(const QString &temporaryDirectoryPattern);
|
void setTemporaryDirectoryPattern(const QString &temporaryDirectoryPattern);
|
||||||
void setProcessPath(const QString &m_processPath);
|
void setProcessPath(const QString &m_processPath);
|
||||||
void setArguments(const QStringList &m_arguments);
|
void setArguments(const QStringList &m_arguments);
|
||||||
|
void setEnvironment(const Utils::Environment &environment);
|
||||||
void setObserver(QObject *m_observer);
|
void setObserver(QObject *m_observer);
|
||||||
|
|
||||||
std::future<QProcessUniquePointer> createProcess() const;
|
std::future<QProcessUniquePointer> createProcess() const;
|
||||||
@@ -72,6 +74,7 @@ private:
|
|||||||
QString m_processPath;
|
QString m_processPath;
|
||||||
QString m_temporaryDirectoryPattern;
|
QString m_temporaryDirectoryPattern;
|
||||||
QStringList m_arguments;
|
QStringList m_arguments;
|
||||||
|
Utils::Environment m_environment;
|
||||||
QObject *m_observer = nullptr;
|
QObject *m_observer = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ template <typename Type>
|
|||||||
class TypeTable
|
class TypeTable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct Compare: std::binary_function<Type, Type, bool> {
|
struct Compare {
|
||||||
bool operator()(const Type &value, const Type &other) const {
|
bool operator()(const Type &value, const Type &other) const {
|
||||||
return value.isLessThan(&other);
|
return value.isLessThan(&other);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ AbstractSymbolGroupNodePtrVector linkedListChildList(SymbolGroupValue headNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper function for linkedListChildList that returns a member by name
|
// Helper function for linkedListChildList that returns a member by name
|
||||||
class MemberByName : public std::unary_function<const SymbolGroupValue &, SymbolGroupValue>
|
class MemberByName
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit MemberByName(const char *name) : m_name(name) {}
|
explicit MemberByName(const char *name) : m_name(name) {}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void split(const std::string &s, char sep, Iterator it)
|
|||||||
|
|
||||||
// A boolean predicate that can be used for grepping sequences
|
// A boolean predicate that can be used for grepping sequences
|
||||||
// of strings for a 'needle' substring.
|
// of strings for a 'needle' substring.
|
||||||
class SubStringPredicate : public std::unary_function<const std::string &, bool>
|
class SubStringPredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit SubStringPredicate(const char *needle) : m_needle(needle) {}
|
explicit SubStringPredicate(const char *needle) : m_needle(needle) {}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ std::string SymbolGroup::debug(const std::string &iname,
|
|||||||
|
|
||||||
typedef std::pair<unsigned, std::string> InamePathEntry;
|
typedef std::pair<unsigned, std::string> InamePathEntry;
|
||||||
|
|
||||||
struct InamePathEntryLessThan : public std::binary_function<InamePathEntry, InamePathEntry, bool> {
|
struct InamePathEntryLessThan {
|
||||||
bool operator()(const InamePathEntry &i1, const InamePathEntry& i2) const
|
bool operator()(const InamePathEntry &i1, const InamePathEntry& i2) const
|
||||||
{
|
{
|
||||||
if (i1.first < i2.first)
|
if (i1.first < i2.first)
|
||||||
|
|||||||
@@ -801,7 +801,7 @@ QTextStream &operator<<(QTextStream &s, const FileName &fn)
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
template <>
|
template <>
|
||||||
void withNTFSPermissions(const std::function<void()> &task)
|
void withNtfsPermissions(const std::function<void()> &task)
|
||||||
{
|
{
|
||||||
qt_ntfs_permission_lookup++;
|
qt_ntfs_permission_lookup++;
|
||||||
task();
|
task();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class QWidget;
|
|||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FileName &c);
|
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FileName &c);
|
||||||
|
|
||||||
// for withNTFSPermissions
|
// for withNtfsPermissions
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
|
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
|
||||||
#endif
|
#endif
|
||||||
@@ -135,7 +135,7 @@ public:
|
|||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T withNTFSPermissions(const std::function<T()> &task)
|
T withNtfsPermissions(const std::function<T()> &task)
|
||||||
{
|
{
|
||||||
qt_ntfs_permission_lookup++;
|
qt_ntfs_permission_lookup++;
|
||||||
T result = task();
|
T result = task();
|
||||||
@@ -144,12 +144,12 @@ T withNTFSPermissions(const std::function<T()> &task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
QTCREATOR_UTILS_EXPORT void withNTFSPermissions(const std::function<void()> &task);
|
QTCREATOR_UTILS_EXPORT void withNtfsPermissions(const std::function<void()> &task);
|
||||||
|
|
||||||
#else // Q_OS_WIN
|
#else // Q_OS_WIN
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T withNTFSPermissions(const std::function<T()> &task)
|
T withNtfsPermissions(const std::function<T()> &task)
|
||||||
{
|
{
|
||||||
return task();
|
return task();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ using enable_if_has_char_data_pointer = typename std::enable_if_t<
|
|||||||
std::is_same<
|
std::is_same<
|
||||||
std::remove_const_t<
|
std::remove_const_t<
|
||||||
std::remove_pointer_t<
|
std::remove_pointer_t<
|
||||||
std::result_of_t<
|
decltype(std::declval<const String>().data())
|
||||||
decltype(&String::data)(String)
|
|
||||||
>
|
|
||||||
>
|
>
|
||||||
>, char>::value
|
>, char>::value
|
||||||
, int>;
|
, int>;
|
||||||
|
|||||||
@@ -48,11 +48,10 @@ ClangTidyClazyRunControl::ClangTidyClazyRunControl(
|
|||||||
ClangToolRunner *ClangTidyClazyRunControl::createRunner()
|
ClangToolRunner *ClangTidyClazyRunControl::createRunner()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_clangExecutable.isEmpty(), return 0);
|
QTC_ASSERT(!m_clangExecutable.isEmpty(), return 0);
|
||||||
QTC_ASSERT(!m_clangLogFileDir.isEmpty(), return 0);
|
|
||||||
|
|
||||||
auto runner = new ClangTidyClazyRunner(m_diagnosticConfig,
|
auto runner = new ClangTidyClazyRunner(m_diagnosticConfig,
|
||||||
m_clangExecutable,
|
m_clangExecutable,
|
||||||
m_clangLogFileDir,
|
m_temporaryDir.path(),
|
||||||
m_environment,
|
m_environment,
|
||||||
this);
|
this);
|
||||||
connect(runner, &ClangTidyClazyRunner::finishedWithSuccess,
|
connect(runner, &ClangTidyClazyRunner::finishedWithSuccess,
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/temporarydirectory.h>
|
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -232,6 +231,7 @@ ClangToolRunControl::ClangToolRunControl(RunControl *runControl,
|
|||||||
: RunWorker(runControl)
|
: RunWorker(runControl)
|
||||||
, m_projectBuilder(new ProjectBuilder(runControl, target->project(), this))
|
, m_projectBuilder(new ProjectBuilder(runControl, target->project(), this))
|
||||||
, m_clangExecutable(CppTools::clangExecutable(CLANG_BINDIR))
|
, m_clangExecutable(CppTools::clangExecutable(CLANG_BINDIR))
|
||||||
|
, m_temporaryDir("clangtools-XXXXXX")
|
||||||
, m_target(target)
|
, m_target(target)
|
||||||
, m_fileInfos(fileInfos)
|
, m_fileInfos(fileInfos)
|
||||||
{
|
{
|
||||||
@@ -299,9 +299,7 @@ void ClangToolRunControl::start()
|
|||||||
Utils::NormalMessageFormat);
|
Utils::NormalMessageFormat);
|
||||||
|
|
||||||
// Create log dir
|
// Create log dir
|
||||||
Utils::TemporaryDirectory temporaryDir("qtc-clangtools-XXXXXX");
|
if (!m_temporaryDir.isValid()) {
|
||||||
temporaryDir.setAutoRemove(false);
|
|
||||||
if (!temporaryDir.isValid()) {
|
|
||||||
const QString errorMessage
|
const QString errorMessage
|
||||||
= toolName + tr(": Failed to create temporary dir, stop.");
|
= toolName + tr(": Failed to create temporary dir, stop.");
|
||||||
appendMessage(errorMessage, Utils::ErrorMessageFormat);
|
appendMessage(errorMessage, Utils::ErrorMessageFormat);
|
||||||
@@ -310,7 +308,6 @@ void ClangToolRunControl::start()
|
|||||||
reportFailure(errorMessage);
|
reportFailure(errorMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_clangLogFileDir = temporaryDir.path();
|
|
||||||
|
|
||||||
// Collect files
|
// Collect files
|
||||||
const AnalyzeUnits unitsToProcess = unitsToAnalyze(CLANG_VERSION);
|
const AnalyzeUnits unitsToProcess = unitsToAnalyze(CLANG_VERSION);
|
||||||
@@ -388,13 +385,15 @@ void ClangToolRunControl::analyzeNextFile()
|
|||||||
Utils::StdOutFormat);
|
Utils::StdOutFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath,
|
void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath)
|
||||||
const QString &logFilePath)
|
|
||||||
{
|
{
|
||||||
|
const QString logFilePath = qobject_cast<ClangToolRunner *>(sender())->logFilePath();
|
||||||
qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath;
|
qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath;
|
||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
const QList<Diagnostic> diagnostics = tool()->read(filePath, logFilePath, &errorMessage);
|
const QList<Diagnostic> diagnostics = tool()->read(filePath, logFilePath, &errorMessage);
|
||||||
|
QFile::remove(logFilePath); // Clean-up.
|
||||||
|
|
||||||
if (!errorMessage.isEmpty()) {
|
if (!errorMessage.isEmpty()) {
|
||||||
qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage;
|
qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage;
|
||||||
const QString filePath = qobject_cast<ClangToolRunner *>(sender())->filePath();
|
const QString filePath = qobject_cast<ClangToolRunner *>(sender())->filePath();
|
||||||
@@ -415,6 +414,9 @@ void ClangToolRunControl::onRunnerFinishedWithFailure(const QString &errorMessag
|
|||||||
qCDebug(LOG).noquote() << "onRunnerFinishedWithFailure:"
|
qCDebug(LOG).noquote() << "onRunnerFinishedWithFailure:"
|
||||||
<< errorMessage << '\n' << errorDetails;
|
<< errorMessage << '\n' << errorDetails;
|
||||||
|
|
||||||
|
// Even in the error case the log file was created, so clean it up here, too.
|
||||||
|
QFile::remove(qobject_cast<ClangToolRunner *>(sender())->logFilePath());
|
||||||
|
|
||||||
++m_filesNotAnalyzed;
|
++m_filesNotAnalyzed;
|
||||||
m_success = false;
|
m_success = false;
|
||||||
const QString filePath = qobject_cast<ClangToolRunner *>(sender())->filePath();
|
const QString filePath = qobject_cast<ClangToolRunner *>(sender())->filePath();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <cpptools/projectinfo.h>
|
#include <cpptools/projectinfo.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -69,7 +70,7 @@ protected:
|
|||||||
|
|
||||||
virtual ClangToolRunner *createRunner() = 0;
|
virtual ClangToolRunner *createRunner() = 0;
|
||||||
|
|
||||||
void onRunnerFinishedWithSuccess(const QString &filePath, const QString &logFilePath);
|
void onRunnerFinishedWithSuccess(const QString &filePath);
|
||||||
void onRunnerFinishedWithFailure(const QString &errorMessage, const QString &errorDetails);
|
void onRunnerFinishedWithFailure(const QString &errorMessage, const QString &errorDetails);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -90,7 +91,7 @@ protected:
|
|||||||
ProjectBuilder *m_projectBuilder;
|
ProjectBuilder *m_projectBuilder;
|
||||||
Utils::Environment m_environment;
|
Utils::Environment m_environment;
|
||||||
QString m_clangExecutable;
|
QString m_clangExecutable;
|
||||||
QString m_clangLogFileDir;
|
Utils::TemporaryDirectory m_temporaryDir;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<ProjectExplorer::Target> m_target;
|
QPointer<ProjectExplorer::Target> m_target;
|
||||||
|
|||||||
@@ -105,11 +105,6 @@ bool ClangToolRunner::run(const QString &filePath, const QStringList &compilerOp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ClangToolRunner::filePath() const
|
|
||||||
{
|
|
||||||
return m_filePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClangToolRunner::onProcessStarted()
|
void ClangToolRunner::onProcessStarted()
|
||||||
{
|
{
|
||||||
emit started();
|
emit started();
|
||||||
@@ -121,10 +116,11 @@ void ClangToolRunner::onProcessFinished(int exitCode, QProcess::ExitStatus exitS
|
|||||||
if (exitCode == 0) {
|
if (exitCode == 0) {
|
||||||
qCDebug(LOG).noquote() << "Output:\n" << Utils::SynchronousProcess::normalizeNewlines(
|
qCDebug(LOG).noquote() << "Output:\n" << Utils::SynchronousProcess::normalizeNewlines(
|
||||||
QString::fromLocal8Bit(m_processOutput));
|
QString::fromLocal8Bit(m_processOutput));
|
||||||
emit finishedWithSuccess(m_filePath, actualLogFile());
|
emit finishedWithSuccess(m_filePath);
|
||||||
|
} else {
|
||||||
|
emit finishedWithFailure(finishedWithBadExitCode(m_name, exitCode),
|
||||||
|
processCommandlineAndOutput());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
emit finishedWithFailure(finishedWithBadExitCode(m_name, exitCode), processCommandlineAndOutput());
|
|
||||||
} else { // == QProcess::CrashExit
|
} else { // == QProcess::CrashExit
|
||||||
emit finishedWithFailure(finishedDueToCrash(m_name), processCommandlineAndOutput());
|
emit finishedWithFailure(finishedDueToCrash(m_name), processCommandlineAndOutput());
|
||||||
}
|
}
|
||||||
@@ -147,7 +143,7 @@ QString ClangToolRunner::createLogFile(const QString &filePath) const
|
|||||||
{
|
{
|
||||||
const QString fileName = QFileInfo(filePath).fileName();
|
const QString fileName = QFileInfo(filePath).fileName();
|
||||||
const QString fileTemplate = m_clangLogFileDir
|
const QString fileTemplate = m_clangLogFileDir
|
||||||
+ QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX.plist");
|
+ QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX");
|
||||||
|
|
||||||
Utils::TemporaryFile temporaryFile("clangtools");
|
Utils::TemporaryFile temporaryFile("clangtools");
|
||||||
temporaryFile.setAutoRemove(false);
|
temporaryFile.setAutoRemove(false);
|
||||||
@@ -170,15 +166,5 @@ QString ClangToolRunner::processCommandlineAndOutput() const
|
|||||||
QString::fromLocal8Bit(m_processOutput)));
|
QString::fromLocal8Bit(m_processOutput)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ClangToolRunner::actualLogFile() const
|
|
||||||
{
|
|
||||||
if (QFileInfo(m_logFile).size() == 0) {
|
|
||||||
// Current clang-cl ignores -o, always putting the log file into the working directory.
|
|
||||||
return m_clangLogFileDir + QLatin1Char('/') + QFileInfo(m_filePath).completeBaseName()
|
|
||||||
+ QLatin1String(".plist");
|
|
||||||
}
|
|
||||||
return m_logFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ClangTools
|
} // namespace ClangTools
|
||||||
|
|||||||
@@ -52,11 +52,12 @@ public:
|
|||||||
// (2) -o output-file
|
// (2) -o output-file
|
||||||
bool run(const QString &filePath, const QStringList &compilerOptions = QStringList());
|
bool run(const QString &filePath, const QStringList &compilerOptions = QStringList());
|
||||||
|
|
||||||
QString filePath() const;
|
QString filePath() const { return m_filePath; }
|
||||||
|
QString logFilePath() const { return m_logFile; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void started();
|
void started();
|
||||||
void finishedWithSuccess(const QString &filePath, const QString &logFilePath);
|
void finishedWithSuccess(const QString &filePath);
|
||||||
void finishedWithFailure(const QString &errorMessage, const QString &errorDetails);
|
void finishedWithFailure(const QString &errorMessage, const QString &errorDetails);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -71,7 +72,6 @@ private:
|
|||||||
|
|
||||||
QString createLogFile(const QString &filePath) const;
|
QString createLogFile(const QString &filePath) const;
|
||||||
QString processCommandlineAndOutput() const;
|
QString processCommandlineAndOutput() const;
|
||||||
QString actualLogFile() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString m_logFile;
|
QString m_logFile;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ static bool checkFilePath(const QString &filePath, QString *errorMessage)
|
|||||||
QList<Diagnostic> LogFileReader::readSerialized(const QString &filePath, const QString &logFilePath,
|
QList<Diagnostic> LogFileReader::readSerialized(const QString &filePath, const QString &logFilePath,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
if (!checkFilePath(filePath, errorMessage))
|
if (!checkFilePath(logFilePath, errorMessage))
|
||||||
return QList<Diagnostic>();
|
return QList<Diagnostic>();
|
||||||
|
|
||||||
ClangSerializedDiagnosticsReader reader;
|
ClangSerializedDiagnosticsReader reader;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ FilePropertiesDialog::~FilePropertiesDialog()
|
|||||||
|
|
||||||
void FilePropertiesDialog::refresh()
|
void FilePropertiesDialog::refresh()
|
||||||
{
|
{
|
||||||
Utils::withNTFSPermissions<void>([this] {
|
Utils::withNtfsPermissions<void>([this] {
|
||||||
const QFileInfo fileInfo(m_fileName);
|
const QFileInfo fileInfo(m_fileName);
|
||||||
QLocale locale;
|
QLocale locale;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ void FilePropertiesDialog::refresh()
|
|||||||
|
|
||||||
void FilePropertiesDialog::setPermission(QFile::Permissions newPermissions, bool set)
|
void FilePropertiesDialog::setPermission(QFile::Permissions newPermissions, bool set)
|
||||||
{
|
{
|
||||||
Utils::withNTFSPermissions<void>([this, newPermissions, set] {
|
Utils::withNtfsPermissions<void>([this, newPermissions, set] {
|
||||||
QFile::Permissions permissions = QFile::permissions(m_fileName);
|
QFile::Permissions permissions = QFile::permissions(m_fileName);
|
||||||
if (set)
|
if (set)
|
||||||
permissions |= newPermissions;
|
permissions |= newPermissions;
|
||||||
|
|||||||
@@ -203,9 +203,7 @@ public:
|
|||||||
|
|
||||||
if (role == Qt::ToolTipRole) {
|
if (role == Qt::ToolTipRole) {
|
||||||
QString description = m_expander->variableDescription(m_variable);
|
QString description = m_expander->variableDescription(m_variable);
|
||||||
QString value;
|
const QString value = m_expander->value(m_variable).toHtmlEscaped();
|
||||||
if (!m_expander->isPrefixVariable(m_variable))
|
|
||||||
value = m_expander->value(m_variable).toHtmlEscaped();
|
|
||||||
if (!value.isEmpty())
|
if (!value.isEmpty())
|
||||||
description += QLatin1String("<p>") + VariableChooser::tr("Current Value: %1").arg(value);
|
description += QLatin1String("<p>") + VariableChooser::tr("Current Value: %1").arg(value);
|
||||||
return description;
|
return description;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ static QList<QByteArray> fullIdForSymbol(CPlusPlus::Symbol *symbol)
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class ProcessFile: public std::unary_function<QString, QList<CPlusPlus::Usage> >
|
class ProcessFile
|
||||||
{
|
{
|
||||||
const WorkingCopy workingCopy;
|
const WorkingCopy workingCopy;
|
||||||
const CPlusPlus::Snapshot snapshot;
|
const CPlusPlus::Snapshot snapshot;
|
||||||
@@ -177,6 +177,10 @@ class ProcessFile: public std::unary_function<QString, QList<CPlusPlus::Usage> >
|
|||||||
QFutureInterface<CPlusPlus::Usage> *future;
|
QFutureInterface<CPlusPlus::Usage> *future;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// needed by QtConcurrent
|
||||||
|
using argument_type = const Utils::FileName &;
|
||||||
|
using result_type = QList<CPlusPlus::Usage>;
|
||||||
|
|
||||||
ProcessFile(const WorkingCopy &workingCopy,
|
ProcessFile(const WorkingCopy &workingCopy,
|
||||||
const CPlusPlus::Snapshot snapshot,
|
const CPlusPlus::Snapshot snapshot,
|
||||||
CPlusPlus::Document::Ptr symbolDocument,
|
CPlusPlus::Document::Ptr symbolDocument,
|
||||||
@@ -230,7 +234,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class UpdateUI: public std::binary_function<QList<CPlusPlus::Usage> &, QList<CPlusPlus::Usage>, void>
|
class UpdateUI
|
||||||
{
|
{
|
||||||
QFutureInterface<CPlusPlus::Usage> *future;
|
QFutureInterface<CPlusPlus::Usage> *future;
|
||||||
|
|
||||||
@@ -596,7 +600,7 @@ static void searchFinished(SearchResult *search, QFutureWatcher<CPlusPlus::Usage
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class FindMacroUsesInFile: public std::unary_function<QString, QList<CPlusPlus::Usage> >
|
class FindMacroUsesInFile
|
||||||
{
|
{
|
||||||
const WorkingCopy workingCopy;
|
const WorkingCopy workingCopy;
|
||||||
const CPlusPlus::Snapshot snapshot;
|
const CPlusPlus::Snapshot snapshot;
|
||||||
@@ -604,6 +608,10 @@ class FindMacroUsesInFile: public std::unary_function<QString, QList<CPlusPlus::
|
|||||||
QFutureInterface<CPlusPlus::Usage> *future;
|
QFutureInterface<CPlusPlus::Usage> *future;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// needed by QtConcurrent
|
||||||
|
using argument_type = const Utils::FileName &;
|
||||||
|
using result_type = QList<CPlusPlus::Usage>;
|
||||||
|
|
||||||
FindMacroUsesInFile(const WorkingCopy &workingCopy,
|
FindMacroUsesInFile(const WorkingCopy &workingCopy,
|
||||||
const CPlusPlus::Snapshot snapshot,
|
const CPlusPlus::Snapshot snapshot,
|
||||||
const CPlusPlus::Macro ¯o,
|
const CPlusPlus::Macro ¯o,
|
||||||
|
|||||||
@@ -4034,7 +4034,7 @@ void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
|
|||||||
{
|
{
|
||||||
if (response.resultClass == ResultDone) {
|
if (response.resultClass == ResultDone) {
|
||||||
const QString debugInfoLocation = runParameters().debugInfoLocation;
|
const QString debugInfoLocation = runParameters().debugInfoLocation;
|
||||||
if (QFile::exists(debugInfoLocation)) {
|
if (!debugInfoLocation.isEmpty() && QFile::exists(debugInfoLocation)) {
|
||||||
const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
|
const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
|
||||||
QString cmd = "set debug-file-directory " + debugInfoLocation;
|
QString cmd = "set debug-file-directory " + debugInfoLocation;
|
||||||
if (!curDebugInfoLocations.isEmpty())
|
if (!curDebugInfoLocations.isEmpty())
|
||||||
|
|||||||
@@ -508,7 +508,8 @@ QString PropertyEditorQmlBackend::fileFromUrl(const QUrl &url)
|
|||||||
|
|
||||||
bool PropertyEditorQmlBackend::checkIfUrlExists(const QUrl &url)
|
bool PropertyEditorQmlBackend::checkIfUrlExists(const QUrl &url)
|
||||||
{
|
{
|
||||||
return QFileInfo::exists(fileFromUrl(url));
|
const QString &file = fileFromUrl(url);
|
||||||
|
return !file.isEmpty() && QFileInfo::exists(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyEditorQmlBackend::emitSelectionToBeChanged()
|
void PropertyEditorQmlBackend::emitSelectionToBeChanged()
|
||||||
|
|||||||
@@ -683,7 +683,7 @@ static QString matchingLine(unsigned position, const QString &source)
|
|||||||
return source.mid(start, end - start);
|
return source.mid(start, end - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProcessFile: public std::unary_function<QString, QList<FindReferences::Usage> >
|
class ProcessFile
|
||||||
{
|
{
|
||||||
ContextPtr context;
|
ContextPtr context;
|
||||||
typedef FindReferences::Usage Usage;
|
typedef FindReferences::Usage Usage;
|
||||||
@@ -692,6 +692,10 @@ class ProcessFile: public std::unary_function<QString, QList<FindReferences::Usa
|
|||||||
QFutureInterface<Usage> *future;
|
QFutureInterface<Usage> *future;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// needed by QtConcurrent
|
||||||
|
using argument_type = const QString &;
|
||||||
|
using result_type = QList<Usage>;
|
||||||
|
|
||||||
ProcessFile(const ContextPtr &context,
|
ProcessFile(const ContextPtr &context,
|
||||||
QString name,
|
QString name,
|
||||||
const ObjectValue *scope,
|
const ObjectValue *scope,
|
||||||
@@ -721,7 +725,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchFileForType: public std::unary_function<QString, QList<FindReferences::Usage> >
|
class SearchFileForType
|
||||||
{
|
{
|
||||||
ContextPtr context;
|
ContextPtr context;
|
||||||
typedef FindReferences::Usage Usage;
|
typedef FindReferences::Usage Usage;
|
||||||
@@ -730,6 +734,10 @@ class SearchFileForType: public std::unary_function<QString, QList<FindReference
|
|||||||
QFutureInterface<Usage> *future;
|
QFutureInterface<Usage> *future;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// needed by QtConcurrent
|
||||||
|
using argument_type = const QString &;
|
||||||
|
using result_type = QList<Usage>;
|
||||||
|
|
||||||
SearchFileForType(const ContextPtr &context,
|
SearchFileForType(const ContextPtr &context,
|
||||||
QString name,
|
QString name,
|
||||||
const ObjectValue *scope,
|
const ObjectValue *scope,
|
||||||
@@ -759,12 +767,17 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class UpdateUI: public std::binary_function<QList<FindReferences::Usage> &, QList<FindReferences::Usage>, void>
|
class UpdateUI
|
||||||
{
|
{
|
||||||
typedef FindReferences::Usage Usage;
|
typedef FindReferences::Usage Usage;
|
||||||
QFutureInterface<Usage> *future;
|
QFutureInterface<Usage> *future;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// needed by QtConcurrent
|
||||||
|
using first_argument_type = QList<Usage> &;
|
||||||
|
using second_argument_type = const QList<Usage> &;
|
||||||
|
using result_type = void;
|
||||||
|
|
||||||
UpdateUI(QFutureInterface<Usage> *future): future(future) {}
|
UpdateUI(QFutureInterface<Usage> *future): future(future) {}
|
||||||
|
|
||||||
void operator()(QList<Usage> &, const QList<Usage> &usages)
|
void operator()(QList<Usage> &, const QList<Usage> &usages)
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ void ExamplesWelcomePage::openProject(const ExampleItem &item)
|
|||||||
|
|
||||||
// If the Qt is a distro Qt on Linux, it will not be writable, hence compilation will fail
|
// If the Qt is a distro Qt on Linux, it will not be writable, hence compilation will fail
|
||||||
// Same if it is installed in non-writable location for other reasons
|
// Same if it is installed in non-writable location for other reasons
|
||||||
const bool needsCopy = withNTFSPermissions<bool>([proFileInfo] {
|
const bool needsCopy = withNtfsPermissions<bool>([proFileInfo] {
|
||||||
QFileInfo pathInfo(proFileInfo.path());
|
QFileInfo pathInfo(proFileInfo.path());
|
||||||
return !proFileInfo.isWritable()
|
return !proFileInfo.isWritable()
|
||||||
|| !pathInfo.isWritable() /* path of .pro file */
|
|| !pathInfo.isWritable() /* path of .pro file */
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
|||||||
QList<int> mibs = QTextCodec::availableMibs();
|
QList<int> mibs = QTextCodec::availableMibs();
|
||||||
Utils::sort(mibs);
|
Utils::sort(mibs);
|
||||||
QList<int>::iterator firstNonNegative =
|
QList<int>::iterator firstNonNegative =
|
||||||
std::find_if(mibs.begin(), mibs.end(), std::bind2nd(std::greater_equal<int>(), 0));
|
std::find_if(mibs.begin(), mibs.end(), [](int n) { return n >=0; });
|
||||||
if (firstNonNegative != mibs.end())
|
if (firstNonNegative != mibs.end())
|
||||||
std::rotate(mibs.begin(), firstNonNegative, mibs.end());
|
std::rotate(mibs.begin(), firstNonNegative, mibs.end());
|
||||||
foreach (int mib, mibs) {
|
foreach (int mib, mibs) {
|
||||||
|
|||||||
@@ -144,7 +144,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text,
|
|||||||
ProgressData *progress,
|
ProgressData *progress,
|
||||||
bool (QChar::* predicate)() const) const
|
bool (QChar::* predicate)() const) const
|
||||||
{
|
{
|
||||||
return predicateMatchSucceed(text, length, progress, std::mem_fun_ref(predicate));
|
return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) {
|
||||||
|
return (c.*predicate)();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rule::charPredicateMatchSucceed(const QString &text,
|
bool Rule::charPredicateMatchSucceed(const QString &text,
|
||||||
@@ -152,7 +154,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text,
|
|||||||
ProgressData *progress,
|
ProgressData *progress,
|
||||||
bool (*predicate)(const QChar &)) const
|
bool (*predicate)(const QChar &)) const
|
||||||
{
|
{
|
||||||
return predicateMatchSucceed(text, length, progress, std::ptr_fun(predicate));
|
return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) {
|
||||||
|
return predicate(c);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress)
|
bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress)
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const QString connection = processArguments(application);
|
const QString connection = processArguments(application);
|
||||||
|
|
||||||
clang_toggleCrashRecovery(true);
|
|
||||||
clang_enableStackTraces();
|
clang_enableStackTraces();
|
||||||
|
|
||||||
ClangCodeModelServer clangCodeModelServer;
|
ClangCodeModelServer clangCodeModelServer;
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ public:
|
|||||||
&QFutureWatcher<Result>::finished,
|
&QFutureWatcher<Result>::finished,
|
||||||
onFinished);
|
onFinished);
|
||||||
|
|
||||||
const QFuture<Result> future = Utils::runAsync(m_runner);
|
// Use 16MB stack size as clang_annotateTokens() would with an internal thread.
|
||||||
|
const Utils::StackSizeInBytes stackSize = 1024 * 1024 * 16;
|
||||||
|
const QFuture<Result> future = Utils::runAsync(stackSize, m_runner);
|
||||||
m_futureWatcher.setFuture(future);
|
m_futureWatcher.setFuture(future);
|
||||||
|
|
||||||
return future;
|
return future;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def startCreator(useClang):
|
|||||||
if not startCreatorTryingClang():
|
if not startCreatorTryingClang():
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator -noload ClangCodeModel" + SettingsPath)
|
||||||
finally:
|
finally:
|
||||||
overrideStartApplication()
|
overrideStartApplication()
|
||||||
return startedWithoutPluginError()
|
return startedWithoutPluginError()
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ source("../../shared/qtcreator.py")
|
|||||||
|
|
||||||
# test New Qt Gui Application build and run for release and debug option
|
# test New Qt Gui Application build and run for release and debug option
|
||||||
def main():
|
def main():
|
||||||
startApplication("qtcreator" + SettingsPath)
|
# Start Creator with built-in code model, to avoid having
|
||||||
|
# warnings from the clang code model in "issues" view
|
||||||
|
startCreator(False)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
checkedTargets = createProject_Qt_GUI(tempDir(), "SampleApp")
|
checkedTargets = createProject_Qt_GUI(tempDir(), "SampleApp")
|
||||||
|
|||||||
Reference in New Issue
Block a user