Added dumpers for `tl::expected` and `Utils::Result` utility classes.
Added a basic test.
Useless `enum` prefix from CDB enum types (e.g. `enum MyEnum`)
will be discarded in tests (credits to @hjk).
Note that the include path for the newly added test executable
is based on `__FILE__` macro value so it might easily break
if the sources are reorganized.
Also creating a test for `Utils::Result` is practically
impossible within current setup as it is not a header only class,
so the test binary must actually link against the correct version
of Utils library target.
Fixes: QTCREATORBUG-31795
Change-Id: I7f9ccb92d0c59333a2dca4ba928ac991f1e5238b
Reviewed-by: hjk <hjk@qt.io>
Fixed behavior of the libstdc++ dumpers for the following types
with `_GLIBCXX_DEBUG` macro enabled:
* `std::deque`
* `std::list`
* `std::multimap`
* `std::multiset`
Fixed libc++ dumpers for the following types:
* `std::unordered_map`
* `std::unordered_multimap`
* `std::unordered_multiset`
* `std::unordered_set`
Added a dumper for `std::forward_list`.
Fixes: QTCREATORBUG-20476
Change-Id: I802b0eaf31cdea77d980ca18d4c3fae15a86a3d4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Depending on the size the value now has a different
amount of hex digits displayed.
Amends 738851b5d5.
Change-Id: I99dc2e9d21e8bf3ce067bc452753c1abe68de8c6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Andrii Semkiv <andrii.semkiv@qt.io>
LLDB 3.8/360.x was not working with multiple inheritance even on
the command line, but looks ok nowadays at least in this simple case.
This does not fix the linked task.
Task-number: QTCREATORBUG-31042
Change-Id: Ibc52c9aaf31513af05487657a229fc4945d7e08f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Extend the solution from
commit d86cf5e235
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Sep 24 12:02:06 2020 +0200
Debugger: Retrieve and remember int from native GDB value
to also retrieve the int representation for numeric values
from the corresponding native gdb.Value if a typedef to
an integer or bool type is used, not only when an integer
type is used directly.
This makes expressions for bifield members in the
debugger's expression view show the correct value
when the type of those bitfield members is a typedef
to an integer type.
Extend the "Bitfields" dumper test accordingly.
One real world example where incorrect values were
previously shown is GtkWidgetPrivate from the
GTK library [1].
[1] ebc84a6185/gtk/gtkwidgetprivate.h (L39-76)
Change-Id: Ib39e00ebbfc8d7d9ab10dc89af61f37ec41fb4ee
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The type cache has been split into smaller caches for individual
aspects. Type ids are now integral, not strings.
In addition, there is new supporting code for logging, timing and
profiling
Change-Id: I6db72a149650d42aecf8b899869c542b1303d43b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Avoids a compile issue before being able to execute the test.
Change-Id: Ibc76c16229107e2c23757de682bc78bfe4b7d6e7
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
3b5c377ce5 had fixed them
for GCC >= 13, but unfortunately made them no longer
compile on Windows with MSVC as reported in the Gerrit
change, error below.
Align the implementation of the custom allocator
more with the "23_containers/vector/52591.cc" [1] ones
referred to in the GCC commit [2], in particular
define ctors, so this compiles with both GCC on Linux
and MSVC on Windows.
Move the definition of that custom allocator
to a new macro "MY_ALLOCATOR" to avoid duplication.
Previous error with MSVC:
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): error C2440: 'static_cast': cannot convert from 'myallocator<char>' to 'myallocator<_Tp1>'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: 'myallocator<_Tp1>::myallocator': no overloaded function could convert all the argument types
with
[
_Tp1=std::_Container_proxy
]
C:\Users\davschul\Downloads\Archive\main.cpp(8): note: could be 'myallocator<_Tp1>::myallocator(myallocator<_Tp1> &&)'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: 'myallocator<_Tp1>::myallocator(myallocator<_Tp1> &&)': cannot convert argument 1 from 'myallocator<char>' to 'myallocator<_Tp1> &&'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: Reason: cannot convert from 'myallocator<char>' to 'myallocator<_Tp1>'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\davschul\Downloads\Archive\main.cpp(8): note: or 'myallocator<_Tp1>::myallocator(const myallocator<_Tp1> &)'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: 'myallocator<_Tp1>::myallocator(const myallocator<_Tp1> &)': cannot convert argument 1 from 'myallocator<char>' to 'const myallocator<_Tp1> &'
with
[
_Tp1=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33130\include\xstring(3141): note: Reason: cannot convert from 'myallocator<char>' to 'const myallocator<_Tp1>'
with
[
_Tp1=std::_Container_proxy
]
[1] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/testsuite/23_containers/vector/52591.cc;h=ea80bb277c1f49190ae21b64e738428066eba1e0;hb=64c986b49558a7
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=64c986b49558a7
Change-Id: I13a3ed226a411479ea1d24a2eda490c8f293bf8f
Reviewed-by: David Schulz <david.schulz@qt.io>
Add debugging helper for std::tuple and add
a corresponding dumper test for it.
With this in place, the std::tuple variable and its elements
in the "tuple.cpp" sample program from QTCREATORBUG-25865 are
shown as expected on both, Linux (libstdc++) with GDB or LLDB and with
an MSVC build with CDB on Windows.
A debugging helper for libc++ had already been added in commit
34ff9c97e6.
Task-number: QTCREATORBUG-25865
Change-Id: I24b3d36b5daa26fd4fcb073c4df79015dfe752fc
Reviewed-by: hjk <hjk@qt.io>
GCC commit [1]
commit 64c986b49558a7c356b85bda85195216936c29a3
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Dec 14 15:21:32 2022 +0000
libstdc++: Diagnose broken allocator rebind members
added a static_assert that caused the dumper tests using custom
allocators to fail like this on Debian testing:
DEBUG : tst_Dumpers::dumper(StdBasicString) qtc.debugger.dumpers: In file included from /usr/include/c++/13/ext/alloc_traits.h:34,
from /usr/include/c++/13/bits/basic_string.h:39,
from /usr/include/c++/13/string:54,
from main.cpp:28:
/usr/include/c++/13/bits/alloc_traits.h: In instantiation of ‘struct std::__allocator_traits_base::__rebind<myallocator<char>, char, void>’:
/usr/include/c++/13/bits/alloc_traits.h:94:11: required by substitution of ‘template<class _Alloc, class _Up> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = myallocator<char>; _Up = char]’
/usr/include/c++/13/bits/alloc_traits.h:228:8: required by substitution of ‘template<class _Alloc> template<class _Tp> using std::allocator_traits< <template-parameter-1-1> >::rebind_alloc = std::__alloc_rebind<_Alloc, _Tp> [with _Tp = char; _Alloc = myallocator<char>]’
/usr/include/c++/13/ext/alloc_traits.h:126:65: required from ‘struct __gnu_cxx::__alloc_traits<myallocator<char>, char>::rebind<char>’
/usr/include/c++/13/bits/basic_string.h:90:24: required from ‘class std::__cxx11::basic_string<char, std::char_traits<char>, myallocator<char> >’
main.cpp:56:71: required from here
/usr/include/c++/13/bits/alloc_traits.h:70:31: error: static assertion failed: allocator_traits<A>::rebind_alloc<A::value_type> must be A
70 | _Tp>::value,
| ^~~~~
/usr/include/c++/13/bits/alloc_traits.h:70:31: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make: *** [Makefile:506: main.o] Error 1
Override the rebind behavior of the custom allocator used
in the tests to fix this.
[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=64c986b49558a7
Change-Id: I1cd8370e5f1601b710e28c251061291c65ac44ce
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Cdb always report the type name with all typedefs resolved so we have to
check the original type name for cdb.
Change-Id: Ib7166276075b18e011ea786a5d3468db0e24e9c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Add debugging helpers for std::string_view,
std::basic_string_view and std::u16string_view
and add a corresponding dumper test for them.
With this in place, values of the local variables in the
"string_view.cpp" sample program from QTCREATORBUG-25865 are
shown as expected on both, Linux with GDB or LLDB and with
an MSVC build with CDB on Windows.
Fixes: QTCREATORBUG-25865
Change-Id: If8959e3225d9ce7f427a65ff6f1f134d3ad48e91
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Since frame 0 points to the Windows DebugBreak function it does not hold
any usable locals, so we have to pass the correct frame to the
lldbbridge test infrastructure in order to get usable data.
Change-Id: I2595be87a718d73fda3429017efd564e5d0ed9be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit will enable running of tst_dumpers on Windows using a MSVC
setup and lldb.exe as debugger.
Change-Id: I17611cc90ba2a04ec21aae11af16f1d0ff8e894f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
There is no added value in providing the value of the
internal 'engaged' - just provide the value if possible.
Change-Id: I8c308902bf82c43e4238568fc9b185c3a3994b47
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Fixes it for Qt 5.4 and onwards hopefully.
Fixes: QTCREATORBUG-29737
Change-Id: Ic555e304a872dfbd458a95097e4e0b6a6632509a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.
Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Compilers are getting increasingly better in optimizing this stuff
out, it's difficult and rather unnecessary to keep track of all
variations.
Change-Id: I9e05d5afadc4d875dc3b61e61364cf085a825239
Reviewed-by: David Schulz <david.schulz@qt.io>
and disable the QV4::Value dumper for that version.
Change-Id: I31a0ddba2bdab3b196e4fc5298fd8e7c10f9dc92
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Adding the data as pointers allow casting the data to the actual derived
class
Change-Id: Id1b421c2729c6da8bf17054e39b4f1e8d8ff2cfa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
...for cdb when we have no nativeValue. This is the case whenever we
have a container like std::vector, QList or a c array to the base class.
Fixes: QTCREATORBUG-28337
Change-Id: I18c63dfbc207d76bf41d85d5da83f7f4603504f9
Reviewed-by: hjk <hjk@qt.io>
Directly display the containing value without the need to expand the
variant. Additionally fix the dumper for Windows and add tests.
Change-Id: Iaae49470750fa3659339331e1518e13020df7938
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Disable QVariant holding a typedef'ed QMap for
now (insignificant).
Adapt expectations for QVariant holding a QList.
Change-Id: I188e01b2d53d17057207db06e9e848a5bfb3adb2
Reviewed-by: hjk <hjk@qt.io>