diff mbox

Add libstdc++ pretty printers for Library Fundamentals TS types

Message ID 20140723104532.GN2361@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely July 23, 2014, 10:45 a.m. UTC
On 15/07/14 13:03 +0100, Jonathan Wakely wrote:
>On 14/07/14 20:31 +0100, Jonathan Wakely wrote:
>>This adds printers for the types in the std::experimental namespace.

This should fix the test failures that Paolo and HJ are seeing, older
versions of GDB didn't have the gdb.Type.name attribute.

(I suppose I could have just put the full basic_string<char, ...> name
in explicitly instead of using lookup_type, but I'll just make this
fix for now.)

Committed to trunk.

Comments

Paolo Carlini July 26, 2014, 5:01 p.m. UTC | #1
Hi,

On 07/23/2014 12:45 PM, Jonathan Wakely wrote:
> On 15/07/14 13:03 +0100, Jonathan Wakely wrote:
>> On 14/07/14 20:31 +0100, Jonathan Wakely wrote:
>>> This adds printers for the types in the std::experimental namespace.
>
> This should fix the test failures that Paolo and HJ are seeing, older
> versions of GDB didn't have the gdb.Type.name attribute.
Confirmed fixed, by the way.

Thanks!
Paolo.
diff mbox

Patch

commit 827e07f7e08bc993a284996f7772b04f82ee7fc9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jul 23 11:40:02 2014 +0100

    	* python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Convert type
    	to string instead of using gdb.Type.name attribute.

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 625396b..15d7a88 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -899,7 +899,7 @@  class StdExpAnyPrinter(SingleObjContainerPrinter):
                 raise ValueError("Unknown manager function in std::experimental::any")
 
             # FIXME need to expand 'std::string' so that gdb.lookup_type works
-            mgrname = re.sub("std::string(?!\w)", gdb.lookup_type('std::string').strip_typedefs().name, m.group(1))
+            mgrname = re.sub("std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
             mgrtype = gdb.lookup_type(mgrname)
             self.contained_type = mgrtype.template_argument(0)
             valptr = None