forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user