Commit 79c8a8fb authored by hjk's avatar hjk

Debugger: Fix libc++ std::{unique,shared}_ptr dumpers

Change-Id: I9efb22543bf31f43381e57fb0acf4aeb15e8a293
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent a6cae022
......@@ -2452,6 +2452,24 @@ def qdump__std__shared_ptr(d, value):
d.putIntItem("usecount", refcount["_M_use_count"])
d.putIntItem("weakcount", refcount["_M_weak_count"])
def qdump__std____1__shared_ptr(d, value):
i = value["__ptr_"]
if isNull(i):
d.putValue("(null)")
d.putNumChild(0)
return
if isSimpleType(d.templateArgument(value.type, 0)):
d.putValue("%s @0x%x" % (i.dereference().value, pointerValue(i)))
else:
d.putValue("@0x%x" % pointerValue(i))
d.putNumChild(3)
with Children(d, 3):
d.putSubItem("data", i.dereference())
d.putFields(value["__cntrl_"].dereference())
#d.putIntItem("usecount", refcount["_M_use_count"])
#d.putIntItem("weakcount", refcount["_M_weak_count"])
def qdump__std__unique_ptr(d, value):
i = value["_M_t"]["_M_head_impl"]
......@@ -2470,6 +2488,23 @@ def qdump__std__unique_ptr(d, value):
with Children(d, 1):
d.putSubItem("data", i)
def qdump__std____1__unique_ptr(d, value):
i = childAt(childAt(value["__ptr_"], 0), 0)
if isNull(i):
d.putValue("(null)")
d.putNumChild(0)
return
if isSimpleType(d.templateArgument(value.type, 0)):
d.putValue("%s @0x%x" % (i.dereference().value, pointerValue(i)))
else:
d.putValue("@0x%x" % pointerValue(i))
d.putNumChild(1)
with Children(d, 1):
d.putSubItem("data", i.dereference())
def qedit__std__vector(expr, value):
values = value.split(',')
......
......@@ -347,9 +347,9 @@ struct Cxx11Profile : public Profile
{}
};
struct MacLibStdCppProfile : public Profile
struct MacLibCppProfile : public Profile
{
MacLibStdCppProfile()
MacLibCppProfile()
: Profile("macx {\n"
"QMAKE_CXXFLAGS += -stdlib=libc++\n"
"LIBS += -stdlib=libc++\n"
......@@ -2379,7 +2379,7 @@ void tst_Dumpers::dumper_data()
"unused(&a, &b);\n")
% CoreProfile()
% Cxx11Profile()
% MacLibStdCppProfile()
% MacLibCppProfile()
% Check("a", "<4 items>", "std::array<int, 4u>")
% Check("b", "<4 items>", "std::array<@QString, 4u>");
......@@ -2682,6 +2682,7 @@ void tst_Dumpers::dumper_data()
"std::unique_ptr<int> pi(new int(32));\n"
"std::unique_ptr<Foo> pf(new Foo);\n")
% Cxx11Profile()
% MacLibCppProfile()
% Check("pi", Pointer("32"), "std::unique_ptr<int, std::default_delete<int> >")
% Check("pf", Pointer(), "std::unique_ptr<Foo, std::default_delete<Foo> >");
......@@ -2690,6 +2691,7 @@ void tst_Dumpers::dumper_data()
"std::shared_ptr<int> pi(new int(32));\n"
"std::shared_ptr<Foo> pf(new Foo);\n")
% Cxx11Profile()
% MacLibCppProfile()
% Check("pi", Pointer("32"), "std::shared_ptr<int>")
% Check("pf", Pointer(), "std::shared_ptr<Foo>");
......
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