summaryrefslogtreecommitdiff
path: root/libstdc++-v3/python
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 11:31:56 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 11:31:56 +0000
commit4c4fb6b0d3dd30277fdeff58d9df10c567163261 (patch)
tree04c02ea6ce247ef1526b3adba1a34edfcc8fd0a7 /libstdc++-v3/python
parent7717ea00902734bd90371e34af23d0b73287f875 (diff)
downloadgcc-4c4fb6b0d3dd30277fdeff58d9df10c567163261.tar.gz
PR libstdc++/45403
* python/libstdcxx/v6/printers.py: Check for lazy_string support. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/python')
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 5333c57634f..bf3689bb707 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -580,7 +580,9 @@ class StdStringPrinter:
reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
header = ptr.cast(reptype) - 1
len = header.dereference ()['_M_length']
- return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
+ if hasattr(ptr, "lazy_string"):
+ return ptr.lazy_string (length = len)
+ return ptr.string (length = len)
def display_hint (self):
return 'string'