OSDN Git Service

PR libstdc++/45403
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Oct 2010 11:31:56 +0000 (11:31 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Oct 2010 11:31:56 +0000 (11:31 +0000)
* 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

libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/printers.py

index 532547b..172eb5b 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-08  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR libstdc++/45403
+       * python/libstdcxx/v6/printers.py: Check for lazy_string support.
+
 2010-10-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/std/future (uses_allocator<packaged_task<>,>): Add;
index 5333c57..bf3689b 100644 (file)
@@ -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'