summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-11-10 15:29:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-11-10 15:29:11 +0100
commite639c4e2a43d4378af263f062b3ca06af8ed8c15 (patch)
treee510c9c8ec314440129e5739e21d84f6c0347cbc /solenv
parent1413b6a4fd6cd0909115566c94882bbc82f43b39 (diff)
Do not deref (potentially dangling) weak_ptr
Change-Id: Ic9694aa8bd85fe0548b8f5fc5f52b4bbd6dce1cf
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gdb/boost/smart_ptr.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/solenv/gdb/boost/smart_ptr.py b/solenv/gdb/boost/smart_ptr.py
index 6646e12ea5f8..60d88278a5ac 100644
--- a/solenv/gdb/boost/smart_ptr.py
+++ b/solenv/gdb/boost/smart_ptr.py
@@ -41,6 +41,16 @@ class SmartPtrPrinter:
else:
return "empty %s" % (self.typename)
+class WeakPtrPrinter:
+ """Prints boost::weak_ptr instances"""
+
+ def __init__(self, typename, value):
+ self.typename = typename
+ self.value = value
+
+ def to_string(self):
+ value = self.value['px']
+ return "%s %s" % (self.typename, value)
printer = None
@@ -54,7 +64,7 @@ def build_pretty_printers():
printer.add('boost::shared_ptr', SmartPtrPrinter)
# printer.add('boost::shared_array', SmartPtrPrinter)
- printer.add('boost::weak_ptr', SmartPtrPrinter)
+ printer.add('boost::weak_ptr', WeakPtrPrinter)
printer.add('boost::scoped_ptr', SmartPtrPrinter)
# printer.add('boost::scoped_array', SmartPtrPrinter)