diff options
author | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2023-04-03 11:31:54 +0200 |
---|---|---|
committer | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2023-04-05 09:16:45 +0000 |
commit | cb4074713facfe9d787d7dd11c3dad87699fc848 (patch) | |
tree | d0076c1e767750556c61ffccfbd7d0752fd6169e /share | |
parent | c53c9592faae66188512a5a067de1235cc37d697 (diff) | |
download | qt-creator-cb4074713facfe9d787d7dd11c3dad87699fc848.tar.gz |
Dumpers: Fix std::string for clang >= 15
libc++ has changed the layout of std::string again.
(see https://reviews.llvm.org/D128285)
This patch adds checks to differentiate between the two versions.
Fixes: QTCREATORBUG-28806
Change-Id: Ic21c488cf1c173120beddf414ca39040dfaba096
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/debugger/libcpp_stdtypes.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/share/qtcreator/debugger/libcpp_stdtypes.py b/share/qtcreator/debugger/libcpp_stdtypes.py index cebd4da435..5a72629da7 100644 --- a/share/qtcreator/debugger/libcpp_stdtypes.py +++ b/share/qtcreator/debugger/libcpp_stdtypes.py @@ -182,6 +182,7 @@ def std_1_string_dumper(d, value): size = 0 size_mode_value = 0 short_mode = False + libcxx_version = 14 layoutModeIsDSC = layoutDecider.name == '__data_' if (layoutModeIsDSC): @@ -200,8 +201,15 @@ def std_1_string_dumper(d, value): if not size_mode: raise Exception("Could not find size_mode") - size_mode_value = size_mode.integer() - short_mode = ((size_mode_value & 1) == 0) + if size_mode.name == '__is_long_': + libcxx_version = 15 + short_mode = (size_mode.integer() == 0) + + size_mode = D[1][0][1] + size_mode_value = size_mode.integer() + else: + size_mode_value = size_mode.integer() + short_mode = ((size_mode_value & 1) == 0) if short_mode: s = D[1] @@ -209,8 +217,13 @@ def std_1_string_dumper(d, value): if not s: raise Exception("Could not find s") - location_sp = s[0] if layoutModeIsDSC else s[1] - size = size_mode_value if layoutModeIsDSC else ((size_mode_value >> 1) % 256) + if libcxx_version == 14: + location_sp = s[0] if layoutModeIsDSC else s[1] + size = size_mode_value if layoutModeIsDSC else ((size_mode_value >> 1) % 256) + elif libcxx_version == 15: + location_sp = s[0] if layoutModeIsDSC else s[2] + size = size_mode_value + else: l = D[0] if not l: |