forked from qt-creator/qt-creator
Dumper: Fix enum display in nested types
When used in SubItem, enums were displayed as "value of type E at address <addr>". Change-Id: Ieecfb791126c6f63f272817afc6c8d05f28b9242 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
c577774177
commit
98b6fd26bf
@@ -2924,6 +2924,8 @@ class DumperBase:
|
||||
return str(simple)
|
||||
if self.ldisplay is not None:
|
||||
return self.ldisplay
|
||||
if self.type.code == TypeCodeEnum:
|
||||
return self.displayEnum()
|
||||
#if self.ldata is not None:
|
||||
# if sys.version_info[0] == 2 and isinstance(self.ldata, buffer):
|
||||
# return bytes(self.ldata).encode('hex')
|
||||
|
@@ -6836,12 +6836,14 @@ void tst_Dumpers::dumper_data()
|
||||
|
||||
|
||||
QTest::newRow("Internal2")
|
||||
<< Data("struct Foo { int bar = 15; }; \n"
|
||||
<< Data("enum E { V1, V2 };\n"
|
||||
"struct Foo { int bar = 15; E e = V1; };\n"
|
||||
"struct QtcDumperTest_PointerArray {\n"
|
||||
" Foo *foos = new Foo[10];\n"
|
||||
"};\n\n",
|
||||
"QtcDumperTest_PointerArray tc; unused(&tc);\n")
|
||||
+ Check("tc.0.bar", "15", "int")
|
||||
+ Check("tc.0.e", "V1 (0)", "E")
|
||||
+ Check("tc.1.bar", "15", "int")
|
||||
+ Check("tc.2.bar", "15", "int")
|
||||
+ Check("tc.3.bar", "15", "int");
|
||||
|
Reference in New Issue
Block a user