summaryrefslogtreecommitdiff
path: root/libstdc++-v3/python
diff options
context:
space:
mode:
authorpmuldoon <pmuldoon@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-20 19:20:42 +0000
committerpmuldoon <pmuldoon@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-20 19:20:42 +0000
commitdf1ac917c9ce90beb8c3804c2d92cb47b337de30 (patch)
treef6b42c11b37cb8cbf0f35b501f8c86d4126cc508 /libstdc++-v3/python
parent5d068519b66a37ab391c427d0aac13f66a9b5c4e (diff)
downloadgcc-df1ac917c9ce90beb8c3804c2d92cb47b337de30.tar.gz
2013-08-20 Phil Muldoon <pmuldoon@redhat.com>
PR libstdc++/53477 http://sourceware.org/bugzilla/show_bug.cgi?id=15195 * python/libstdcxx/v6/printers.py (Printer.__call__): If a value is a reference, fetch referenced value. (RxPrinter.invoke): Ditto. * testsuite/libstdc++-prettyprinters/cxx11.cc (main): Add -O0 flag. Add referenced value tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/python')
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index de50d1e05ec..3465348fbe2 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -786,6 +786,11 @@ class RxPrinter(object):
def invoke(self, value):
if not self.enabled:
return None
+
+ if value.type.code == gdb.TYPE_CODE_REF:
+ if hasattr(gdb.Value,"referenced_value"):
+ value = value.referenced_value()
+
return self.function(self.name, value)
# A pretty-printer that conforms to the "PrettyPrinter" protocol from
@@ -841,6 +846,11 @@ class Printer(object):
return None
basename = match.group(1)
+
+ if val.type.code == gdb.TYPE_CODE_REF:
+ if hasattr(gdb.Value,"referenced_value"):
+ val = val.referenced_value()
+
if basename in self.lookup:
return self.lookup[basename].invoke(val)