forked from qt-creator/qt-creator
Debugger: Adjust libcpp based optional dumper
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>
This commit is contained in:
@@ -508,12 +508,9 @@ def qdump__std____1__variant(d, value):
|
||||
|
||||
def qdump__std____1__optional(d, value):
|
||||
if value['__engaged_'].integer() == 0:
|
||||
d.putSpecialValue("uninitialized")
|
||||
d.putNumChild(2)
|
||||
if d.isExpanded():
|
||||
with Children(d):
|
||||
d.putSubItem("engaged", value['__engaged_'])
|
||||
d.putSubItem("value", value['#1']['__val_'])
|
||||
d.putSpecialValue("empty")
|
||||
else:
|
||||
d.putItem(value['#1']['__val_'])
|
||||
|
||||
|
||||
def qdump__std____1__tuple(d, value):
|
||||
|
@@ -1108,7 +1108,7 @@ def qdump__std__optional(d, value):
|
||||
d.putItem(payload)
|
||||
d.putBetterType(innerType)
|
||||
else:
|
||||
d.putSpecialValue("uninitialized")
|
||||
d.putSpecialValue("empty")
|
||||
|
||||
|
||||
def qdump__std__experimental__optional(d, value):
|
||||
|
@@ -5627,7 +5627,7 @@ void tst_Dumpers::dumper_data()
|
||||
|
||||
+ Cxx17Profile()
|
||||
|
||||
+ Check("o1", "<uninitialized>", "std::optional<bool>")
|
||||
+ Check("o1", "<empty>", "std::optional<bool>")
|
||||
+ Check("o2", "1", "bool") // 1 -> true is done on display
|
||||
+ Check("o3", "<3 items>", "std::vector<int>")
|
||||
+ Check("o3.1", "[1]", "2", "int");
|
||||
|
Reference in New Issue
Block a user