]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/45403 (python pretty printer for std::string requires GDB 7.1)
authorJonathan Wakely <jwakely.gcc@gmail.com>
Fri, 8 Oct 2010 11:31:56 +0000 (11:31 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 8 Oct 2010 11:31:56 +0000 (12:31 +0100)
PR libstdc++/45403
* python/libstdcxx/v6/printers.py: Check for lazy_string support.

From-SVN: r165163

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

index 532547bf84b62dadc15b2b532720bb9c13b3c155..172eb5b17366af421da2c9e5f9653dafa0ddad4b 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 5333c57634fab62907947dac37e2e82eab414d47..bf3689bb7076b6317f8125a5b56c84027d66bdbf 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'