From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6351 invoked by alias); 22 Mar 2010 12:19:58 -0000 Received: (qmail 6339 invoked by uid 22791); 22 Mar 2010 12:19:58 -0000 X-SWARE-Spam-Status: No, hits=-8.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Mar 2010 12:19:53 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2MCJqb1019592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Mar 2010 08:19:52 -0400 Received: from qcore.mollernet.net (vpn-11-98.rdu.redhat.com [10.11.11.98]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2MCJpms016817; Mon, 22 Mar 2010 08:19:51 -0400 Message-ID: <4BA76067.4060404@redhat.com> Date: Mon, 22 Mar 2010 12:19:00 -0000 From: Chris Moller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: tromey@redhat.com CC: gdb-patches@sourceware.org Subject: Re: pr9065 patch (the typeid thing) References: <4B96B1C6.9050907@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00749.txt.bz2 On 03/11/10 16:32, Tom Tromey wrote: > > Chris> Another difference is that the real typeid returns mangled names, > Chris> leaving it to the user to demangle. This strikes me as a pain, so I > Chris> just provide the demangled names. > > It should be compatible. GDB has a demangle command for this purpose. > > I've done a lot of re-write on this patch over the last week or so, but the requirement for returning mangled names turns out to be a bit of a stopper: mangled names for built-in types don't exist at all in gdb, and mangled names for symbols are only occasionally available. My first thought was to clone the gcc mangler; my second thought was that's not really the best solution. I don't know if it's intended for gdb to be able to debug stuff compiled by anything other than gcc, but since every compiler uses its own mangling algo, forcing the use of the gcc mangling algo certainly wouldn't be compatible with that. Also, though I don't know how likely it is, it's not impossible that the gcc algo could change. At least one of the probable reasons mangled symbol names aren't available seems to be that they're not emitted in the DWARF. In my testcase, of the dozen or so vars and fcns I use, the mangled name of only one of them appears in the DWARF (tagged with DW_AT_MIPS_linkage_name--why just that one symbol and nothing else, I haven't a clue), so my guess is that if gcc could somehow be convinced to emit the mangled names of all symbols and primitive types, things would be cool, but I don't know how hard it would be to get gcc (i.e., its maintainers) to do that.. (I couldn't find a gcc option that made that happen...) Chris