From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19567 invoked by alias); 14 Sep 2011 19:33:54 -0000 Received: (qmail 19553 invoked by uid 22791); 14 Sep 2011 19:33:53 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Sep 2011 19:33:39 +0000 X-Loopcount0: from 10.170.28.39 From: To: Date: Wed, 14 Sep 2011 19:33:00 -0000 Subject: Python: gdb.Type.template_argument method issue Message-ID: <09787EF419216C41A903FD14EE5506DD0307EF93D7@AUSX7MCPC103.AMER.DELL.COM> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2011-09/txt/msg00048.txt.bz2 The template_argument method assumes that all template arguments are types.= =A0 While that's the most common, other things are also found in the wild.= =A0 My C++ book says that the arguments can be integers, enums, pointers, r= eferences, or pointer-to-member constant values.=A0 (GCC doesn't want to ac= cept pointers and references, perhaps because it thinks they are relocatabl= e.) Looking at the code, it appears that the template_argument method will be l= ooking at the demangled type string.=A0 It seems that that's insufficient t= o sort out exactly what a given template argument is.=A0 For example, if it= 's an enum, the method will simply see the enum value name, but I don't see= how it would know which enum type that is so that doesn't allow it to nail= down exactly what we have. I figure that the thing to do would be to have the method return either a g= db.Type or a gdb.Value, depending on what the template argument is. =A0But = it looks like it needs more detailed knowledge about the template arguments= than it has in the current logic, and I don't know enough GDB to know wher= e to look for that.=20 Any hints on where to look? =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 paul