Commit 0b57c8de authored by hjk's avatar hjk

Debugger: Fix LLDB display of std::array with "complex" content

Change-Id: I43dd9b8afe76f204fe2509f1f2f81f74c48a16ab
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7017e955
...@@ -737,7 +737,7 @@ class Dumper: ...@@ -737,7 +737,7 @@ class Dumper:
def putArrayData(self, type, base, n, def putArrayData(self, type, base, n,
childNumChild = None, maxNumChild = 10000): childNumChild = None, maxNumChild = 10000):
if not self.tryPutArrayContents(type, base, n): if not self.tryPutArrayContents(type, base, n):
base = base.cast(type.pointer()) base = self.createPointerValue(base, type)
with Children(self, n, type, childNumChild, maxNumChild, with Children(self, n, type, childNumChild, maxNumChild,
base, type.GetByteSize()): base, type.GetByteSize()):
for i in self.childRange(): for i in self.childRange():
......
...@@ -2148,7 +2148,11 @@ def qdump__std__array(d, value): ...@@ -2148,7 +2148,11 @@ def qdump__std__array(d, value):
d.putNumChild(size) d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
innerType = d.templateArgument(value.type, 0) innerType = d.templateArgument(value.type, 0)
d.putArrayData(innerType, value.address, size) d.putArrayData(innerType, d.addressOf(value), size)
def qdump__std____1__array(d, value):
qdump__std__array(d, value)
def qdump__std__complex(d, value): def qdump__std__complex(d, value):
......
...@@ -330,8 +330,30 @@ struct Profile ...@@ -330,8 +330,30 @@ struct Profile
struct Cxx11Profile : public Profile struct Cxx11Profile : public Profile
{ {
//Cxx11Profile() : Profile("CONFIG += c++11") {} Cxx11Profile()
Cxx11Profile() : Profile("QMAKE_CXXFLAGS += -std=c++0x") {} : Profile("greaterThan(QT_MAJOR_VERSION,4): CONFIG += c++11\n"
"else: QMAKE_CXXFLAGS += -std=c++0x\n")
{}
};
struct MacLibStdCppProfile : public Profile
{
MacLibStdCppProfile()
: Profile("macx {\n"
"QMAKE_CXXFLAGS += -stdlib=libc++\n"
"LIBS += -stdlib=libc++\n"
"QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7\n"
"QMAKE_IOS_DEPLOYMENT_TARGET = 10.7\n"
"QMAKE_CFLAGS -= -mmacosx-version-min=10.6\n"
"QMAKE_CFLAGS += -mmacosx-version-min=10.7\n"
"QMAKE_CXXFLAGS -= -mmacosx-version-min=10.6\n"
"QMAKE_CXXFLAGS += -mmacosx-version-min=10.7\n"
"QMAKE_OBJECTIVE_CFLAGS -= -mmacosx-version-min=10.6\n"
"QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.7\n"
"QMAKE_LFLAGS -= -mmacosx-version-min=10.6\n"
"QMAKE_LFLAGS += -mmacosx-version-min=10.7\n"
"}")
{}
}; };
struct GdbOnly {}; struct GdbOnly {};
...@@ -959,6 +981,7 @@ void tst_Dumpers::dumper() ...@@ -959,6 +981,7 @@ void tst_Dumpers::dumper()
qDebug() << "CONTENTS : " << contents; qDebug() << "CONTENTS : " << contents;
qDebug() << "Qt VERSION : " qDebug() << "Qt VERSION : "
<< qPrintable(QString::number(context.qtVersion, 16)); << qPrintable(QString::number(context.qtVersion, 16));
qDebug() << "BUILD DIR : " << qPrintable(t->buildPath);
} }
QVERIFY(ok); QVERIFY(ok);
t->buildTemp.setAutoRemove(m_keepTemp); t->buildTemp.setAutoRemove(m_keepTemp);
...@@ -2317,6 +2340,7 @@ void tst_Dumpers::dumper_data() ...@@ -2317,6 +2340,7 @@ void tst_Dumpers::dumper_data()
"unused(&a, &b);\n") "unused(&a, &b);\n")
% CoreProfile() % CoreProfile()
% Cxx11Profile() % Cxx11Profile()
% MacLibStdCppProfile()
% Check("a", "<4 items>", "std::array<int, 4u>") % Check("a", "<4 items>", "std::array<int, 4u>")
% Check("b", "<4 items>", "std::array<@QString, 4u>"); % Check("b", "<4 items>", "std::array<@QString, 4u>");
......
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