Commit 708f539d by Jonathan Wakely Committed by Jonathan Wakely

re PR libstdc++/45403 (python pretty printer for std::string requires GDB 7.1)

	PR libstdc++/45403
	* python/libstdcxx/v6/printers.py: Check for lazy_string support.

From-SVN: r165163
parent 105b5e65
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> 2010-10-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/future (uses_allocator<packaged_task<>,>): Add; * include/std/future (uses_allocator<packaged_task<>,>): Add;
......
...@@ -580,7 +580,9 @@ class StdStringPrinter: ...@@ -580,7 +580,9 @@ class StdStringPrinter:
reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer () reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
header = ptr.cast(reptype) - 1 header = ptr.cast(reptype) - 1
len = header.dereference ()['_M_length'] 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): def display_hint (self):
return 'string' return 'string'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment