Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().
Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
On Windows the debugging of clang tools is not working due to the
nature of how processes are started.
This makes it possible to use DebugViewer or DebugViewPP
Change-Id: I2c1e4bb7a8fafd6f07570e5d2ba4df5b44e9d44d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
On Windows the debug messages are not sent to the Windows logger, because a
custom Qt message handler was set up.
This commit forwards the messages also to the default message handler.
Change-Id: I1745a86f72fcc1e48cd52603633fca2f23c8fedf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
The tidy check SuspiciousMissingCommaCheck uses the locale dependent
stod() when reading settings and might throw std::invalid_argument for a
locale different than "C".
Fixes: QTCREATORBUG-21605
Change-Id: I69bf719a8fd94e13ce67b46238f536c85ab2eaa3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Printing the stack strace in the event of a crash is very useful, but in
the worst case it can also result in a deadlock, without any trace being
printed, rendering the clangbackend completely useless.
For example, if a thread allocates memory (lock) and another thread
crashes right then, clang's stack trace printer is invoked, which
(unfortunately) also tries to allocate memory (deadlock). This was
observed with QTCREATORBUG-21559.
The stack trace printer should be fixed in clang. Until then, disable
printing stack traces by default and allow to enable when explicitly
requested (QTC_CLANG_ENABLE_STACKTRACES=1).
Task-number: QTCREATORBUG-21559
Change-Id: I418cea7f3d70bc8a9cae333b3858228650307c6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Instead, set the default level of all logs to QtWarningMsg.
The call to setFilterRules overrides the user preferences in qtlogging.ini.
Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
...because
1. We already run in a separate process.
2. It's not entirely clear in which state we end up after a crash,
except for:
3. A "crashed" translation unit won't be freed, even when calling
clang_disposeTranslationUnit().
This avoids undefined behavior within clangbackend and accumulated
leaking memory in the long run. On the other side, crashes within
libclang will crash clangbackend now, too.
Change-Id: I0789c52db08ace2f7e181e3b7bdfc9f595f75e8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...to see them in both qtcreator application output
and DebugView.
clangbackend is a separate process which provides
QtCreator stdout and stderr channels so we need to
have QDebug messages there in order to receive them.
Change-Id: I2edc4de1ca203b061395b0b3070e4471348eaad7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
We had all debug output disabled by default, even the one generated from
QTC_ASSERT and friends.
Change-Id: Ie41eac49c2c3da25f584e43d7c9a292715b3f355
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Before the QLocalServer was in the ConnectionServer so more than one
client could connect to the server. But we never used that possibility
which made the hand shaking much more difficult. It is now moved
in the client, so that there is always a QLocalServer.
Change-Id: Ifa357074b0c0809434c49d23b1cee38496f72f43
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The server and client are adaptable by template parameter.
Change-Id: Ia28e2863ca73b633689964ea1df6df08f8358ac1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
We want to share more functionality of the IPC mechanism and for what we
need more interface classes. But we use this names already for the
ClangCodeModel implementation. So we rename the them to ClangCodeModel*.
Change-Id: Ie320e0d3b993586a9bcc6a5aa0d32427af41202e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.
Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Output a proper usage message instead of a cryptic "wrong argument
count" when launching it from the shell for testing.
Change-Id: Iedb6b1062c9d246a514aefb05220942e4a6341df
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
...apparently they are enabled by default.
Change-Id: I6bda380655050c62e124de451a8aefd440cf4b91
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>