Commit e15912d7 authored by hjk's avatar hjk

debugger: implement dumper for std::complex

Change-Id: I75905e26930b02df077f6b62f837855b83b4d8d8
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 95f1bb19
......@@ -1692,12 +1692,26 @@ def qdump__QWeakPointer(d, value):
def qdump__QxXmlAttributes(d, value):
pass
#######################################################################
#
# Standard Library dumper
#
#######################################################################
def qdump__std__complex(d, value):
innerType = templateArgument(value.type, 0)
base = value.address.cast(innerType.pointer())
real = base.dereference()
imag = (base + 1).dereference()
d.putValue("(%f, %f)" % (real, imag));
d.putNumChild(2)
if d.isExpanded():
with Children(d, 2, childType=innerType):
d.putSubItem("real", real)
d.putSubItem("imag", imag)
def qdump__std__deque(d, value):
innerType = templateArgument(value.type, 0)
innerSize = innerType.sizeof
......
......@@ -158,6 +158,7 @@ void dummyStatement(...) {}
#include <QStandardItemModel>
#include <QLabel>
#include <complex>
#include <deque>
#include <iostream>
#include <iterator>
......@@ -2258,6 +2259,20 @@ namespace qxml {
} // namespace qxml
namespace stdcomplex {
void testStdComplex()
{
std::complex<double> c(1, 2);
BREAK_HERE;
// Expand c.
// Check c (1.000000, 2.000000) complex.
// Continue.
dummyStatement(&c);
}
} // namespace stddeque
namespace stddeque {
void testStdDequeInt()
......@@ -5957,6 +5972,7 @@ int main(int argc, char *argv[])
namespc::testNamespace();
painting::testPainting();
stdcomplex::testStdComplex();
stddeque::testStdDeque();
stdlist::testStdList();
stdhashset::testStdHashSet();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment