From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14262 invoked by alias); 24 Jan 2013 01:54:17 -0000 Received: (qmail 14254 invoked by uid 22791); 24 Jan 2013 01:54:16 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ea0-f176.google.com (HELO mail-ea0-f176.google.com) (209.85.215.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Jan 2013 01:54:12 +0000 Received: by mail-ea0-f176.google.com with SMTP id a13so3463324eaa.35 for ; Wed, 23 Jan 2013 17:54:11 -0800 (PST) X-Received: by 10.14.204.198 with SMTP id h46mr1058487eeo.1.1358992450781; Wed, 23 Jan 2013 17:54:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.201.202 with HTTP; Wed, 23 Jan 2013 17:53:50 -0800 (PST) From: Surya Kiran Gullapalli Date: Thu, 24 Jan 2013 01:54:00 -0000 Message-ID: Subject: gdb.lookup_type problem with boost::multi_index::multi_index_container To: gdb@sourceware.org Content-Type: multipart/mixed; boundary=047d7b343e3c48022004d3ff16e1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00076.txt.bz2 --047d7b343e3c48022004d3ff16e1 Content-Type: text/plain; charset=UTF-8 Content-length: 2387 Hi, I'm using gdb-7.5, on RHEL 6, compiled with gcc-4.7.2. I'm trying to write a pretty printer for boost::multi_index and ran into problems with gdb.lookup_type. Attached code has the following declaration. TestSet ts; Now, at the gdb command prompt, I'm performing the following operations (in python) gdb >> python > set_value = gdb.parse_and_eval('ts') > set_type = set_value.type.strip_typedefs() > t1 = set_type.template_argument(0) # Test > t2 = set_type.template_argument(1) # boost::mult_index::indexed_by .... > t3 = set_type.template_argument(2) # std::allocator > node_type = gdb.lookup_type('boost::multi_index::detail::multi_index_node_type < %s, %s, %s >::type' % (t1, t2, t3)) > base = gdb.lookup_type ('boost::multi_index::detail::multi_index_base_type < %s, %s, %s >::type' % (t1, t2, t3)) > allocator = gdb.lookup_type('boost::detail::allocator::rebind_to<%s, %s>::type' % (t3, node_type)) > end I'm getting the node_type correctly. But gdb is unable to get types for 'base' and 'allocator'. ------------------------ The error for 'base' -------------------- Traceback (most recent call last): File "", line 1, in gdb.error: No type named boost::detail::multi_index_base_type < Test, boost::multi_index::indexed_by, std::allocator >, &Test::s>, mpl_::na, mpl_::na> , boost::multi_index::ordered_unique, boost::multi_i ndex::member, mpl_::na>, boost::multi_index::ordered_unique, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na , mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator >::type. Error while executing Python code. -------------------------------------------------------------- and a similar error for 'allocator'. as boost::multi_index_container is derived from boost::detail::multi_index_base_type, I'm expecting gdb to return a valid type for the same. Am I missing something here. ? Thanks, Surya --047d7b343e3c48022004d3ff16e1 Content-Type: application/octet-stream; name="test.cxx" Content-Disposition: attachment; filename="test.cxx" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hcb8hgcz0 Content-length: 1318 I2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNpbmNs dWRlIDxib29zdC9tdWx0aV9pbmRleF9jb250YWluZXIuaHBwPgojaW5jbHVk ZSA8Ym9vc3QvbXVsdGlfaW5kZXgvbWVtYmVyLmhwcD4KI2luY2x1ZGUgPGJv b3N0L211bHRpX2luZGV4L2tleV9leHRyYWN0b3JzLmhwcD4KI2luY2x1ZGUg PGJ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