From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11444 invoked by alias); 25 Aug 2011 23:03:21 -0000 Received: (qmail 11436 invoked by uid 22791); 25 Aug 2011 23:03:20 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,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; Thu, 25 Aug 2011 23:03:02 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7PN31Le003116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Aug 2011 19:03:01 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7PN2xB2031086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Aug 2011 19:03:00 -0400 Message-ID: <4E56D4A3.7000306@redhat.com> Date: Thu, 25 Aug 2011 23:03:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [RFC] 12266 Fallout 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: 2011-08/txt/msg00474.txt.bz2 Hi, I am writing for some maintainer guidance on an issue that has arisen. The original reporter for c++/12266 reports that the bug is not fixed. And indeed, it isn't! The reporter's test case (C++): typedef std::string foo; void calltest (foo) {} Setting a break at "calltest(foo)" does not work because inspect_type (part of 12266 patchset) uses check_typedef, which resolves foo -> std::string -> std::basic_string, std::alloactor >. But because we are no longer using DMGL_VERBOSE in dwarf2_physname (and other places) to do demangling, the symbol table actually stores "calltest(std::string)". Setting a break at "calltest(std::string)" works. Setting a break at "calltest(std::basic_string)" also does not work for the same reason "foo" didn't work. There are two ways I can see to fix this. 1) Add DMGL_VERBOSE where it is needed so that NO typedefs ever appear in a (non-TYPE_CODE_TYPEDEF) symbol's name, i.e, store "calltest(std::basic_string<...>)" in the symbol table instead of "calltest(std::string)". 2) Add a new version of check_typedef which "stops" at std::string (and std::ostream, std::istream, std::iostream), and add logic (somewhere) to deal with going from "std::basic_string<...>" back to "std::string" (and likewise for the others). For whatever it may be worth, my preference is for #1. I've always felt storing the most fundamental representation of a symbol was the best option: it treats all symbols the same. Along these lines, I have done a quick audit of the code (look for DMGL_PARAMS), and the only places where DMGL_VERBOSE needs to be added is dwarf2_physname, lookup_symbol_in_language, and symbol_find_demangled_name. All other users of DMGL_PARAMS are using it for output to the display, and leaving out DMGL_VERBOSE would be preferred. This will have the immediate side effect of printing symbol names with "std::basic_string<...>" instead of the more preferred "std::string". Actually in this case, the "right" output would be "calltest(foo)", but that is a different, but related, problem, for which I developed a patch a long time ago, part of the first 12266 patch submissions (dwarf2_print_name). So, I humbly ask maintainers: - Shall I continue #1 and start submitting patches? - Shall I start teaching gdb about std::string et al and how to deal with them in the environment we have today? - Have I missed something that would be preferable to anything I've mentioned? Keith