Commit 31933215 authored by hjk's avatar hjk

Debugger: Add a dumper for std::weak_ptr

Change-Id: I253b6d8069ecf36618aa40038da6820f52eb38df
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent f85c6efc
......@@ -651,6 +651,13 @@ def qdump__std____1__wstring(d, value):
d.putType("std::wstring")
def qdump__std____weak_ptr(d, value):
return qdump__std__shared_ptr(d, value)
def qdump__std__weak_ptr(d, value):
return qdump__std__shared_ptr(d, value)
def qdump__std__shared_ptr(d, value):
if d.isMsvcTarget():
i = value["_Ptr"]
......
......@@ -4391,7 +4391,11 @@ void tst_Dumpers::dumper_data()
"#include <string>\n" + fooData,
"std::shared_ptr<int> pi(new int(32)); unused(&pi);\n"
"std::shared_ptr<Foo> pf(new Foo); unused(&pf);\n"
"std::shared_ptr<std::string> ps(new std::string(\"ABC\")); unused(&ps);\n")
"std::shared_ptr<std::string> ps(new std::string(\"ABC\")); "
"unused(&ps);\n"
"std::weak_ptr<int> wi = pi; unused(&wi);\n"
"std::weak_ptr<Foo> wf = pf; unused(&wf);\n"
"std::weak_ptr<std::string> ws = ps; unused(&ws);\n")
+ Cxx11Profile()
+ MacLibCppProfile()
......@@ -4401,7 +4405,13 @@ void tst_Dumpers::dumper_data()
+ Check("pf", Pointer(), "std::shared_ptr<Foo>")
+ CheckType("pf.data", "Foo")
+ Check("ps", "\"ABC\"", "std::shared_ptr<std::string>")
+ Check("ps.data", "\"ABC\"", "std::string");
+ Check("ps.data", "\"ABC\"", "std::string")
+ Check("wi", "32", "std::weak_ptr<int>")
+ Check("wi.data", "32", "int")
+ Check("wf", Pointer(), "std::weak_ptr<Foo>")
+ CheckType("wf.data", "Foo")
+ Check("ws", "\"ABC\"", "std::weak_ptr<std::string>")
+ Check("ws.data", "\"ABC\"", "std::string");
QTest::newRow("StdSharedPtr2")
<< Data("#include <memory>\n"
......
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